编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#24111 #1132. wzk的欧几里得 Accepted 100 16 ms 388 K C++ / 471 B iNx 2020-03-29 12:29:29
显示原始代码
#include <iostream>
#include <cstdio>
namespace iNx {
typedef long long LL;
LL F(int n) {
    if (n == 0)
        return 1;
    LL a, b, c;
    a = b = 1;
    while (n--) {
        c = a + b;
        a = b;
        b = c;
    }
    return a + b;
}
void work() {
    int n;
    scanf("%d", &n);
    printf("%lld\n", F(n));
}
}  // namespace iNx
int main() {
    int T;
    scanf("%d", &T);
    while (T--) iNx::work();
    return 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:4 ms
内存:388 KiB

输入文件(1.in

2
0
1

答案文件(1.out

1
3

用户输出

1
3

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:3 ms
内存:356 KiB

输入文件(2.in

5
5
4
0
1
2

答案文件(2.out

21
13
1
3
5

用户输出

21
13
1
3
5

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:3 ms
内存:348 KiB

输入文件(3.in

10
1
4
6
1
6
0
5
6
6
5

答案文件(3.out

3
13
34
3
34
1
21
34
34
21

用户输出

3
13
34
3
34
1
21
34
34
21

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:3 ms
内存:356 KiB

输入文件(4.in

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>

答案文件(4.out

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
测试点 #5
Accepted
得分:100
用时:3 ms
内存:356 KiB

输入文件(5.in

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>

答案文件(5.out

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