用户输出
1
3
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#23709 | #1132. wzk的欧几里得 | Accepted | 100 | 15 ms | 352 K | C++ / 529 B | 计试91-周翼腾 | 2020-02-16 18:49:26 |
#include <iostream>
#define my_wife Accurate_Balance
using namespace std;
unsigned long long antigcd(int n, unsigned long long a, unsigned long long b) {
if (n == 0)
return a + b;
else {
unsigned long long temp = a;
a = a + b;
b = temp;
return antigcd(n - 1, a, b);
}
}
int main() {
int T, n;
cin >> T;
for (int i = 0; i < T; i++) {
cin >> n;
if (n == 0)
cout << 1 << endl;
else {
unsigned long long answer = antigcd(n - 1, 2, 1);
cout << answer << endl;
}
}
return 0;
}
用户输出
3
13
34
3
34
1
21
34
34
21
系统信息
Exited with return code 0
81
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<136 bytes omitted>
1
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765
10946
17711
28657
46368
75025
121393
<720 bytes omitted>
用户输出
1
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
2584
4181
6765
10946
17711
28657
46368
75025
121393
196418
317811
514229
832040
<692 bytes omitted>
系统信息
Exited with return code 0
81
17
1
34
27
26
5
51
53
1
32
8
70
26
77
57
42
12
63
42
19
46
74
29
39
78
11
28
23
59
76
16
30
44
5
<135 bytes omitted>
6765
3
24157817
832040
514229
21
86267571272
225851433717
3
9227465
89
806515533049393
514229
234167
<674 bytes omitted>
用户输出
6765
3
24157817
832040
514229
21
86267571272
225851433717
3
9227465
89
806515533049393
514229
23416728348467685
1548008755920
11
<646 bytes omitted>
系统信息
Exited with return code 0