Submission #21138
ソースコード
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 36 37 38 39 40 41 42 43 44 | #include<iostream> #include<algorithm> #include<unordered_map> #include<map> #include<set> #include<random> #include<limits.h> #include<string.h> #include<functional> #include<stdlib.h> #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #include<ext/pb_ds/tag_and_trait.hpp> #define T LLONG_MAX/3 using namespace __gnu_pbds; using namespace std; #define int long long int a[100000]; signed main() { tree< int , null_type, less< int >, rb_tree_tag, tree_order_statistics_node_update> S; S.insert(T); int N, Q; scanf ( "%lld%lld" , &N,&Q); fill(a, a + N, T); for ( int i = 0; i < Q; ++i) { int x; scanf ( "%lld" , &x); if (x == 1) { int y, z; scanf ( "%lld%lld" , &y, &z); y--; if (a[y] > z) { if (a[y] != T) { S.erase(-(a[y] * 100000 + y)); } S.insert(-(z * 100000 + y)); a[y]=z; } } else { int y; scanf ( "%lld" , &y); cout << S.order_of_key(-y * 100000) << endl; } } } |
ステータス
項目 | データ |
---|---|
問題 | 0757 - ghoststudents |
ユーザー名 | naoki2016 |
投稿日時 | 2017-07-08 12:55:12 |
言語 | C++17 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 1345 Byte |
最大実行時間 | 118 ms |
最大メモリ使用量 | 1452 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 10 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
00_sample_01.in | WA | 16 ms | 480 KB |
1
|
01_small_01.in | WA | 21 ms | 452 KB |
1
|
01_small_02.in | WA | 12 ms | 420 KB |
1
|
01_small_03.in | WA | 14 ms | 520 KB |
1
|
01_small_04.in | WA | 18 ms | 488 KB |
1
|
01_small_05.in | AC | 20 ms | 328 KB |
1
|
01_small_06.in | AC | 13 ms | 424 KB |
1
|
01_small_07.in | WA | 20 ms | 520 KB |
1
|
01_small_08.in | AC | 19 ms | 488 KB |
1
|
01_small_09.in | AC | 17 ms | 456 KB |
1
|
01_small_10.in | WA | 16 ms | 552 KB |
1
|
02_random_01.in | WA | 118 ms | 908 KB |
1
|
02_random_02.in | WA | 24 ms | 796 KB |
1
|
02_random_03.in | WA | 33 ms | 932 KB |
1
|
02_random_04.in | WA | 22 ms | 1168 KB |
1
|
02_random_05.in | WA | 35 ms | 740 KB |
1
|
02_random_06.in | WA | 39 ms | 1144 KB |
1
|
02_random_07.in | WA | 35 ms | 1304 KB |
1
|
02_random_08.in | WA | 35 ms | 1064 KB |
1
|
02_random_09.in | WA | 34 ms | 980 KB |
1
|
02_random_10.in | WA | 29 ms | 792 KB |
1
|
02_random_11.in | WA | 27 ms | 1092 KB |
1
|
02_random_12.in | WA | 28 ms | 736 KB |
1
|
02_random_13.in | WA | 28 ms | 1156 KB |
1
|
02_random_14.in | WA | 29 ms | 1140 KB |
1
|
02_random_15.in | WA | 24 ms | 1288 KB |
1
|
02_random_16.in | WA | 24 ms | 660 KB |
1
|
02_random_17.in | WA | 20 ms | 648 KB |
1
|
02_random_18.in | WA | 30 ms | 1196 KB |
1
|
02_random_19.in | WA | 27 ms | 1032 KB |
1
|
02_random_20.in | WA | 33 ms | 520 KB |
1
|
02_random_21.in | WA | 32 ms | 916 KB |
1
|
02_random_22.in | WA | 25 ms | 812 KB |
1
|
02_random_23.in | WA | 23 ms | 972 KB |
1
|
02_random_24.in | WA | 28 ms | 800 KB |
1
|
02_random_25.in | WA | 27 ms | 1436 KB |
1
|
02_random_26.in | WA | 32 ms | 884 KB |
1
|
02_random_27.in | WA | 26 ms | 972 KB |
1
|
02_random_28.in | WA | 29 ms | 1204 KB |
1
|
02_random_29.in | WA | 23 ms | 788 KB |
1
|
02_random_30.in | WA | 35 ms | 880 KB |
1
|
03_large_01.in | WA | 35 ms | 1324 KB |
1
|
03_large_02.in | WA | 25 ms | 1284 KB |
1
|
03_large_03.in | WA | 28 ms | 1248 KB |
1
|
03_large_04.in | WA | 27 ms | 1336 KB |
1
|
03_large_05.in | WA | 30 ms | 1296 KB |
1
|
03_large_06.in | WA | 29 ms | 1260 KB |
1
|
03_large_07.in | WA | 28 ms | 1360 KB |
1
|
03_large_08.in | WA | 27 ms | 1452 KB |
1
|
03_large_09.in | WA | 25 ms | 1284 KB |
1
|
03_large_10.in | WA | 34 ms | 1376 KB |
1
|