QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#180992 | #7225. The Kirakira Cycle | ckiseki# | WA | 1109ms | 3612kb | C++17 | 688b | 2023-09-16 14:55:54 | 2023-09-16 14:55:55 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n;
cin >> n;
auto f = [n](int x) {
int res = 0;
for (int i = 2; i <= n; i++)
res += x % i;
return res;
};
mt19937 rng(12390);
int mx = 0;
for (int it = 0; it < 20; it++) {
int x = rng() % (n * n), y = x;
int c = 0;
do {
x = f(x);
y = f(f(y));
++c;
} while (x != y);
int ans = 0;
do {
y = f(y);
++ans;
} while (y != x);
mx = max(mx, ans);
// cerr << "c = " << c << endl;
// cerr << "ans = " << ans << endl;
}
cout << mx << '\n';
// cout << "ans = " << ans << endl;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3436kb
input:
2
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3444kb
input:
10
output:
4
result:
ok 1 number(s): "4"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
43
output:
7
result:
ok 1 number(s): "7"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
1
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: 0
Accepted
time: 1ms
memory: 3444kb
input:
3
output:
1
result:
ok 1 number(s): "1"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3444kb
input:
4
output:
3
result:
ok 1 number(s): "3"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3464kb
input:
5
output:
2
result:
ok 1 number(s): "2"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3448kb
input:
6
output:
2
result:
ok 1 number(s): "2"
Test #9:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
7
output:
1
result:
ok 1 number(s): "1"
Test #10:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
8
output:
3
result:
ok 1 number(s): "3"
Test #11:
score: 0
Accepted
time: 1ms
memory: 3444kb
input:
9
output:
2
result:
ok 1 number(s): "2"
Test #12:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
11
output:
7
result:
ok 1 number(s): "7"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
13
output:
6
result:
ok 1 number(s): "6"
Test #14:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
17
output:
4
result:
ok 1 number(s): "4"
Test #15:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
19
output:
5
result:
ok 1 number(s): "5"
Test #16:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
23
output:
3
result:
ok 1 number(s): "3"
Test #17:
score: 0
Accepted
time: 1ms
memory: 3388kb
input:
29
output:
2
result:
ok 1 number(s): "2"
Test #18:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
31
output:
13
result:
ok 1 number(s): "13"
Test #19:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
37
output:
5
result:
ok 1 number(s): "5"
Test #20:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
41
output:
21
result:
ok 1 number(s): "21"
Test #21:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
60
output:
8
result:
ok 1 number(s): "8"
Test #22:
score: 0
Accepted
time: 0ms
memory: 3452kb
input:
100
output:
11
result:
ok 1 number(s): "11"
Test #23:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
105
output:
41
result:
ok 1 number(s): "41"
Test #24:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
128
output:
31
result:
ok 1 number(s): "31"
Test #25:
score: 0
Accepted
time: 2ms
memory: 3444kb
input:
130
output:
25
result:
ok 1 number(s): "25"
Test #26:
score: 0
Accepted
time: 3ms
memory: 3448kb
input:
256
output:
52
result:
ok 1 number(s): "52"
Test #27:
score: 0
Accepted
time: 3ms
memory: 3444kb
input:
290
output:
15
result:
ok 1 number(s): "15"
Test #28:
score: 0
Accepted
time: 7ms
memory: 3448kb
input:
455
output:
104
result:
ok 1 number(s): "104"
Test #29:
score: 0
Accepted
time: 0ms
memory: 3380kb
input:
512
output:
45
result:
ok 1 number(s): "45"
Test #30:
score: 0
Accepted
time: 12ms
memory: 3440kb
input:
777
output:
35
result:
ok 1 number(s): "35"
Test #31:
score: 0
Accepted
time: 14ms
memory: 3440kb
input:
707
output:
175
result:
ok 1 number(s): "175"
Test #32:
score: 0
Accepted
time: 5ms
memory: 3520kb
input:
449
output:
13
result:
ok 1 number(s): "13"
Test #33:
score: 0
Accepted
time: 12ms
memory: 3432kb
input:
573
output:
168
result:
ok 1 number(s): "168"
Test #34:
score: 0
Accepted
time: 9ms
memory: 3436kb
input:
858
output:
49
result:
ok 1 number(s): "49"
Test #35:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
230
output:
58
result:
ok 1 number(s): "58"
Test #36:
score: 0
Accepted
time: 14ms
memory: 3612kb
input:
972
output:
117
result:
ok 1 number(s): "117"
Test #37:
score: 0
Accepted
time: 11ms
memory: 3604kb
input:
844
output:
47
result:
ok 1 number(s): "47"
Test #38:
score: 0
Accepted
time: 7ms
memory: 3376kb
input:
378
output:
37
result:
ok 1 number(s): "37"
Test #39:
score: 0
Accepted
time: 4ms
memory: 3440kb
input:
423
output:
49
result:
ok 1 number(s): "49"
Test #40:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
209
output:
20
result:
ok 1 number(s): "20"
Test #41:
score: 0
Accepted
time: 280ms
memory: 3460kb
input:
5645
output:
338
result:
ok 1 number(s): "338"
Test #42:
score: 0
Accepted
time: 59ms
memory: 3432kb
input:
2034
output:
249
result:
ok 1 number(s): "249"
Test #43:
score: 0
Accepted
time: 426ms
memory: 3600kb
input:
6163
output:
206
result:
ok 1 number(s): "206"
Test #44:
score: 0
Accepted
time: 369ms
memory: 3388kb
input:
6422
output:
346
result:
ok 1 number(s): "346"
Test #45:
score: 0
Accepted
time: 28ms
memory: 3448kb
input:
1550
output:
40
result:
ok 1 number(s): "40"
Test #46:
score: 0
Accepted
time: 583ms
memory: 3524kb
input:
6940
output:
674
result:
ok 1 number(s): "674"
Test #47:
score: 0
Accepted
time: 37ms
memory: 3380kb
input:
2068
output:
157
result:
ok 1 number(s): "157"
Test #48:
score: 0
Accepted
time: 390ms
memory: 3432kb
input:
6197
output:
594
result:
ok 1 number(s): "594"
Test #49:
score: 0
Accepted
time: 624ms
memory: 3456kb
input:
6456
output:
913
result:
ok 1 number(s): "913"
Test #50:
score: 0
Accepted
time: 651ms
memory: 3524kb
input:
8776
output:
423
result:
ok 1 number(s): "423"
Test #51:
score: 0
Accepted
time: 173ms
memory: 3428kb
input:
3904
output:
281
result:
ok 1 number(s): "281"
Test #52:
score: 0
Accepted
time: 183ms
memory: 3444kb
input:
4163
output:
230
result:
ok 1 number(s): "230"
Test #53:
score: 0
Accepted
time: 226ms
memory: 3440kb
input:
4422
output:
631
result:
ok 1 number(s): "631"
Test #54:
score: 0
Accepted
time: 167ms
memory: 3436kb
input:
4681
output:
95
result:
ok 1 number(s): "95"
Test #55:
score: 0
Accepted
time: 888ms
memory: 3568kb
input:
8810
output:
835
result:
ok 1 number(s): "835"
Test #56:
score: 0
Accepted
time: 195ms
memory: 3528kb
input:
3938
output:
350
result:
ok 1 number(s): "350"
Test #57:
score: 0
Accepted
time: 1109ms
memory: 3564kb
input:
9328
output:
373
result:
ok 1 number(s): "373"
Test #58:
score: 0
Accepted
time: 455ms
memory: 3604kb
input:
4456
output:
932
result:
ok 1 number(s): "932"
Test #59:
score: 0
Accepted
time: 369ms
memory: 3528kb
input:
4715
output:
476
result:
ok 1 number(s): "476"
Test #60:
score: 0
Accepted
time: 506ms
memory: 3604kb
input:
7633
output:
591
result:
ok 1 number(s): "591"
Test #61:
score: 0
Accepted
time: 218ms
memory: 3572kb
input:
2762
output:
263
result:
ok 1 number(s): "263"
Test #62:
score: 0
Accepted
time: 581ms
memory: 3440kb
input:
8152
output:
465
result:
ok 1 number(s): "465"
Test #63:
score: 0
Accepted
time: 166ms
memory: 3524kb
input:
3280
output:
157
result:
ok 1 number(s): "157"
Test #64:
score: 0
Accepted
time: 101ms
memory: 3448kb
input:
3539
output:
79
result:
ok 1 number(s): "79"
Test #65:
score: 0
Accepted
time: 1096ms
memory: 3572kb
input:
7668
output:
905
result:
ok 1 number(s): "905"
Test #66:
score: 0
Accepted
time: 428ms
memory: 3436kb
input:
7927
output:
357
result:
ok 1 number(s): "357"
Test #67:
score: 0
Accepted
time: 811ms
memory: 3468kb
input:
8186
output:
543
result:
ok 1 number(s): "543"
Test #68:
score: 0
Accepted
time: 162ms
memory: 3452kb
input:
3314
output:
306
result:
ok 1 number(s): "306"
Test #69:
score: -100
Wrong Answer
time: 140ms
memory: 3444kb
input:
3573
output:
21
result:
wrong answer 1st numbers differ - expected: '69', found: '21'