AC

黑暗中的那颗星为你而闪耀 · 发布于 2025-07-26 · 浏览 365 回复 0

include <bits/stdc++.h>

using namespace std;

int main() {

int n, day = 0, a, b, c = 1;
cin >> n;
while (1) {
	day++;
	if (c == 1 && (n - 1) % 3 == 0) {
		b = day;
		c = 0;
	}
	a = (n - 1) / 3 + 1;
	n -= a;
	if (n == 0)
		break;
}
cout << day << " " << b;
return 0;

}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复