编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#3691 #1011. 小田的存钱罐 Runtime Error 15 807 ms 676 K C++ 17 / 874 B crazyMouse 2023-11-25 16:21:23
显示原始代码
#include <iostream>
using namespace std;
long long cont[200000000];
int main() {
    long long q;
    cin >> q;
    long long max = 0;
    long long min = 200000000;
    if (!q)
        return 0;
    long long n, x, c;
    long long cont2 = 0;
    while (q) {
        cin >> n;
        switch (n) {
            case 1: {
                cin >> x;
                cont[x] += 1;
                if (max < x)
                    max = x;
                if (min > x)
                    min = x;
                if (cont[x] == 1)
                    cont2 += 1;
                break;
            }
            case 2: {
                cin >> x >> c;
                if (!cont[x])
                    break;
                if (cont[x] >= c)
                    cont[x] -= c;
                else
                    cont[x] = 0;
                if (!cont[x])
                    cont2 -= 1;
                if (!cont2)
                    break;
                if (max == x && !cont[x]) {
                    while (!cont[max] && max > min) max -= 1;
                }
                if (min == x && !cont[x]) {
                    while (!cont[min] && min < max) min += 1;
                }
                break;
            }
            case 3: {
                cout << max - min << endl;
                break;
            }
        }
        q -= 1;
    }
}
子任务 #1
Runtime Error
得分:15
测试点 #1
Accepted
得分:100
用时:3 ms
内存:268 KiB

输入文件(00_sample_01.in

8
1 3
1 2
3
1 2
1 7
3
2 2 3
3

答案文件(00_sample_01.out

1
5
4

用户输出

1
5
4

系统信息

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

输入文件(00_sample_02.in

4
1 10000
1 1000
2 100 3
1 10

系统信息

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

输入文件(01_random_01.in

200000
1 158260522
1 158260522
1 158260522
1 158260522
1 158260522
3
2 158260522 3
1 158260522
3
3
2
<1822667 bytes omitted>

答案文件(01_random_01.out

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

<133130 bytes omitted>

用户输出

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

<133102 bytes omitted>

系统信息

Exited with return code 0
测试点 #4
Runtime Error
得分:0
用时:3 ms
内存:364 KiB

输入文件(01_random_02.in

200000
1 404926844
3
3
1 943492766
3
1 404926844
3
1 404926844
1 943492766
2 404926844 2
2 404926844
<1711818 bytes omitted>

答案文件(01_random_02.out

0
0
538565922
538565922
0
0
0
0
0
0
0
0
538565922
538565922
0
0
0
0
0
538565922
538565922
538565922

<522556 bytes omitted>

系统信息

Killed: Segmentation fault
测试点 #5
Runtime Error
得分:0
用时:4 ms
内存:508 KiB

输入文件(01_random_03.in

200000
1 504709350
3
1 504709350
3
1 669577130
1 565454584
2 669577130 1
2 504709350 1
2 504709350 1
<1687449 bytes omitted>

答案文件(01_random_03.out

0
0
60745234
60745234
60745234
60745234
164867780
164867780
164867780
104122546
164867780
164867780

<690750 bytes omitted>

系统信息

Killed: Segmentation fault
测试点 #6
Runtime Error
得分:0
用时:4 ms
内存:364 KiB

输入文件(01_random_04.in

200000
1 101102
3
1 101102
1 806736280
3
3
2 101102 1
3
1 256060446
3
3
1 806736280
1 372964315
2 25
<1644095 bytes omitted>

答案文件(01_random_04.out

0
806635178
806635178
806635178
806635178
806635178
806635178
806635178
806635178
728074795
80663517
<800164 bytes omitted>

用户输出

0

系统信息

Killed: Segmentation fault
测试点 #7
Runtime Error
得分:0
用时:58 ms
内存:676 KiB

输入文件(01_random_05.in

200000
1 879601392
1 2208309
1 2208309
1 693906524
2 879601392 1
1 693906524
3
1 855648094
1 5626880
<1655382 bytes omitted>

答案文件(01_random_05.out

691698215
853439785
853439785
853439785
853439785
853439785
978284941
978284941
978284941
978284941

<800459 bytes omitted>

系统信息

Killed: Segmentation fault
测试点 #8
Runtime Error
得分:0
用时:3 ms
内存:400 KiB

输入文件(01_random_06.in

200000
1 247639032
1 777329308
3
1 498286185
1 498286185
2 247639032 1
3
3
1 674916137
3
1 916525278
<1680170 bytes omitted>

答案文件(01_random_06.out

529690276
279043123
279043123
279043123
668886246
668886246
668886246
668886246
765842382
765842382

<799363 bytes omitted>

系统信息

Killed: Segmentation fault
测试点 #9
Runtime Error
得分:0
用时:3 ms
内存:356 KiB

输入文件(01_random_07.in

200000
1 655487992
3
3
3
3
3
3
1 611660901
3
3
1 974018054
3
3
3
1 911221319
3
1 762558266
3
3
1 744
<1663388 bytes omitted>

答案文件(01_random_07.out

0
0
0
0
0
0
43827091
43827091
362357153
362357153
362357153
362357153
362357153
362357153
362357153

<800770 bytes omitted>

用户输出

455487992
455487992
455487992
455487992
455487992
455487992
455487992
455487992

系统信息

Killed: Segmentation fault
测试点 #10
Runtime Error
得分:0
用时:5 ms
内存:360 KiB

输入文件(01_random_08.in

200000
1 826143456
3
1 628797840
1 983206966
1 791914334
3
3
1 440668866
3
3
1 214044032
3
3
3
3
3
3
<1666495 bytes omitted>

答案文件(01_random_08.out

0
354409126
354409126
542538100
542538100
769162934
769162934
769162934
769162934
769162934
76916293
<799562 bytes omitted>

系统信息

Killed: Segmentation fault
测试点 #11
Runtime Error
得分:0
用时:3 ms
内存:360 KiB

输入文件(01_random_09.in

200000
1 848837086
3
1 178452624
1 916086662
3
3
3
3
1 96479006
3
3
1 411156951
1 531760231
1 211336
<1450452 bytes omitted>

答案文件(01_random_09.out

0
737634038
737634038
737634038
737634038
819607656
819607656
819607656
819607656
819607656
81960765
<956882 bytes omitted>

系统信息

Killed: Segmentation fault
测试点 #12
Runtime Error
得分:0
用时:6 ms
内存:332 KiB

输入文件(02_killer_01.in

200000
2 293519400 200000
2 914159648 200000
2 115759974 200000
1 980862633
2 897088345 200000
2 976
<2877507 bytes omitted>

答案文件(02_killer_01.out

644345063
644345063
971875820
971875820
971875820
971875820
976625137
976625137
976625137
976625137

<199130 bytes omitted>

系统信息

Killed: Segmentation fault
测试点 #13
Runtime Error
得分:0
用时:5 ms
内存:384 KiB

输入文件(02_killer_02.in

200000
2 197108808 200000
2 938365703 200000
2 421962281 200000
1 69997378
2 981625223 200000
1 8616
<2877806 bytes omitted>

答案文件(02_killer_02.out

791654718
791654718
791654718
893498516
949240756
949240756
949240756
949240756
959853107
977604071

<200470 bytes omitted>

系统信息

Killed: Segmentation fault
测试点 #14
Runtime Error
得分:0
用时:5 ms
内存:360 KiB

输入文件(02_killer_03.in

200000
2 241309635 200000
2 687899457 200000
1 950087837
1 236920052
3
1 550166398
1 521326769
1 248
<2883102 bytes omitted>

答案文件(02_killer_03.out

713167785
713167785
713167785
730494051
730494051
905234424
933105045
933105045
933105045
933105045

<199420 bytes omitted>

系统信息

Killed: Segmentation fault
测试点 #15
Runtime Error
得分:0
用时:6 ms
内存:372 KiB

输入文件(02_killer_04.in

200000
1 249046243
1 249046243
1 249046243
1 249046243
1 249046243
1 249046243
1 249046243
1 2490462
<2559893 bytes omitted>

答案文件(02_killer_04.out

0

系统信息

Killed: Segmentation fault
测试点 #16
Wrong Answer
得分:0
用时:204 ms
内存:356 KiB

输入文件(02_killer_05.in

200000
1 341006745
1 341006745
1 341006745
1 341006745
1 341006745
1 341006745
1 341006745
1 3410067
<2539893 bytes omitted>

答案文件(02_killer_05.out

0

用户输出

141006745

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #17
Runtime Error
得分:0
用时:4 ms
内存:364 KiB

输入文件(02_killer_06.in

200000
1 927123882
1 927123882
1 927123882
1 927123882
1 927123882
1 927123882
1 927123882
1 9271238
<2519893 bytes omitted>

答案文件(02_killer_06.out

0

系统信息

Killed: Segmentation fault
测试点 #18
Wrong Answer
得分:0
用时:123 ms
内存:352 KiB

输入文件(02_killer_07.in

200000
1 865468011
1 865468011
1 865468011
1 865468011
1 865468011
1 865468011
1 865468011
1 8654680
<2499893 bytes omitted>

答案文件(02_killer_07.out

0

用户输出

665468011

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #19
Runtime Error
得分:0
用时:4 ms
内存:352 KiB

输入文件(02_killer_08.in

200000
1 466019537
1 466019537
1 466019537
1 466019537
1 466019537
1 466019537
1 466019537
1 4660195
<2479893 bytes omitted>

答案文件(02_killer_08.out

0

系统信息

Killed: Segmentation fault
测试点 #20
Wrong Answer
得分:0
用时:121 ms
内存:248 KiB

输入文件(02_killer_09.in

200000
1 879738868
1 879738868
1 879738868
1 879738868
1 879738868
1 879738868
1 879738868
1 8797388
<2459893 bytes omitted>

答案文件(02_killer_09.out

0

用户输出

679738868

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0