为什么改不了答案?代码明明对了
查看原帖
为什么改不了答案?代码明明对了
1265632
xhxxwcr楼主2024/7/22 12:55
#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("apple.in","r",stdin);
	freopen("apple.out","w",stdout);
	int n;
	cin >> n;
	int x = n;
	int ansday = 0,ansnum = 0;
	while(x != 0){
		x -= ceil(x / 3.0);
		ansday++;
		if(x % 3 == 1 && !ansnum) ansnum = ansday;
	}
	cout << ansday << " " << ansnum <<endl; 
}
2024/7/22 12:55
加载中...