编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#24657 #2038. 奇怪巧克力 Accepted 100 518 ms 412 K C++ 17 / 661 B 192023211995 2024-12-21 15:54:51
显示原始代码
#include <iostream>
using namespace std;
int map[] = { 0, 1, 2,  3,  4,  5,  6,  7,  8,  9,  1, 2,  3,  4,  5,  6,  7,  8,  9,  10,
              2, 3, 4,  5,  6,  7,  8,  9,  10, 11, 3, 4,  5,  6,  7,  8,  9,  10, 11, 12,
              4, 5, 6,  7,  8,  9,  10, 11, 12, 13, 5, 6,  7,  8,  9,  10, 11, 12, 13, 14,
              6, 7, 8,  9,  10, 11, 12, 13, 14, 15, 7, 8,  9,  10, 11, 12, 13, 14, 15, 16,
              8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 };
int d(int x) {
    int cnt = 0;
    x %= 100;
    return map[x] + (x / 100);
}

int main() {
    cin.tie(0);
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        int cnt = 0;
        for (int i = 0; i <= n; i++)
            if (d(i) > d(i + 1))
                cnt++;
        cout << cnt << endl;
    }
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:4 ms
内存:308 KiB

输入文件(0.in

5
1
9
114
19198
514

答案文件(0.out

0
1
11
1919
51

用户输出

0
1
11
1919
51

系统信息

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

输入文件(1.in

1000
95324
61540
86129
35867
62059
82282
62131
43185
49381
80751
31826
6083
27015
4913
<6785 bytes omitted>

答案文件(1.out

9532
6154
8613
3586
6206
8228
6213
4318
4938
8075
3182
608
2701
4913
3127
1833
9650
<5780 bytes omitted>

用户输出

9532
6154
8613
3586
6206
8228
6213
4318
4938
8075
3182
608
2701
4913
3127
1833
9650
8186
2970
3243
718
4825
3976
2863
1556
6604

<4752 bytes omitted>

系统信息

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

输入文件(2.in

1000
17745
71669
93371
81156
88161
23430
6313
98209
26939
57480
75687
60159
19717
4227
<6799 bytes omitted>

答案文件(2.out

1774
7167
9337
8115
8816
2343
631
9821
2694
5748
7568
6016
1971
4227
5315
8181
8484
<5793 bytes omitted>

用户输出

1774
7167
9337
8115
8816
2343
631
9821
2694
5748
7568
6016
1971
4227
5315
8181
8484
9736
3804
8169
2815
538
6225
7665
2678
6667

<4765 bytes omitted>

系统信息

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

输入文件(3.in

1000
34424
63718
43483
25260
96406
73603
13641
96951
15053
34194
73611
97434
28235
816
<6784 bytes omitted>

答案文件(3.out

3442
6371
4348
2526
9640
7360
1364
9695
1505
3419
7361
9743
2823
8166
2661
9109
4598
<5778 bytes omitted>

用户输出

3442
6371
4348
2526
9640
7360
1364
9695
1505
3419
7361
9743
2823
8166
2661
9109
4598
2623
513
9638
4561
9140
3750
9284
9935
6185
<4750 bytes omitted>

系统信息

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

输入文件(4.in

1000
566
18020
58024
89934
29166
63405
3947
68946
8831
83994
7861
24754
90590
76989
3
<6794 bytes omitted>

答案文件(4.out

56
1802
5802
8993
2916
6340
394
6894
883
8399
786
2475
9059
7699
3132
5525
4528
840
<5788 bytes omitted>

用户输出

56
1802
5802
8993
2916
6340
394
6894
883
8399
786
2475
9059
7699
3132
5525
4528
8407
4163
5939
501
1985
6512
9274
8590
9073
2669
<4760 bytes omitted>

系统信息

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

输入文件(5.in

1000
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
<5391906 bytes omitted>

答案文件(5.out

0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
<4303 bytes omitted>

用户输出

0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
5
5
5
5
5
5
5
5
5
5
6
6
6
6
6
6

<3275 bytes omitted>

系统信息

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

输入文件(6.in

1000
100000
99999
99998
99997
99996
99995
99994
99993
99992
99991
99990
99989
99988
99
<6907 bytes omitted>

答案文件(6.out

10000
10000
9999
9999
9999
9999
9999
9999
9999
9999
9999
9999
9998
9998
9998
9998
99
<5902 bytes omitted>

用户输出

10000
10000
9999
9999
9999
9999
9999
9999
9999
9999
9999
9999
9998
9998
9998
9998
9998
9998
9998
9998
9998
9998
9997
9997
9997
9
<4874 bytes omitted>

系统信息

Exited with return code 0