Submission #00389
ソースコード
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 45 46 47 48 49 50 51 52 53 | #include "bits/stdc++.h" #define in std::cin #define out std::cout #define rep(i,N) for(int i=0;i<N;++i) typedef long long int LL; struct tub { char kind; LL sp; }; LL Q; std::vector<tub>ts; int idx[212345]; int main() { in >> Q; int cou = 0; rep(i, Q) { int com; in >> com; if (com == 1) { LL R, v; char type; in >> R >> type >> v; ts.push_back({ type,v }); idx[i + 1] = cou; ++cou; } else { LL S, L, v; in >> S >> L >> v; for (LL i = idx[S] - 1; i < idx[S] - 1 + L; ++i) { auto tubb = ts[i%ts.size()]; if (tubb.kind == 'A' ) { if (v >= tubb.sp) { v = tubb.sp; } } else if (tubb.kind == 'B' ) { if (v <= tubb.sp) { v = tubb.sp; } } else { v += tubb.sp; } } out << v << std::endl; } } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0006 - tubequery |
ユーザー名 | Bwambocos |
投稿日時 | 2017-11-26 15:08:20 |
言語 | C++17 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 861 Byte |
最大実行時間 | 1000 ms |
最大メモリ使用量 | 10068 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 60 | * |
2 | partial_1 | 0 / 20 | !test_01.txt, *S* |
3 | partial_2 | 0 / 20 | !*, *S*, *M* |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # | ||
---|---|---|---|---|---|---|
!test_01.txt | AC | 17 ms | 480 KB |
1
|
2
|
3
|
!test_02.txt | WA | 18 ms | 704 KB |
1
|
3
|
|
cornL_01.txt | TLE | 1000 ms | 548 KB |
1
|
||
cornL_02.txt | TLE | 1000 ms | 516 KB |
1
|
||
cornS_01.txt | WA | 27 ms | 620 KB |
1
|
2
|
3
|
cornS_02.txt | WA | 19 ms | 584 KB |
1
|
2
|
3
|
hand_01.txt | TLE | 1000 ms | 548 KB |
1
|
||
hand_02.txt | WA | 29 ms | 524 KB |
1
|
||
hand_03.txt | TLE | 1000 ms | 492 KB |
1
|
||
randL_01.txt | TLE | 1000 ms | 600 KB |
1
|
||
randL_02.txt | TLE | 1000 ms | 572 KB |
1
|
||
randL_03.txt | TLE | 1000 ms | 544 KB |
1
|
||
randL_04.txt | TLE | 1000 ms | 644 KB |
1
|
||
randL_05.txt | TLE | 1000 ms | 496 KB |
1
|
||
randL_06.txt | TLE | 1000 ms | 468 KB |
1
|
||
randL_07.txt | TLE | 1000 ms | 432 KB |
1
|
||
randL_08.txt | TLE | 1000 ms | 404 KB |
1
|
||
randL_09.txt | TLE | 1000 ms | 376 KB |
1
|
||
randL_10.txt | TLE | 1000 ms | 348 KB |
1
|
||
randM_01.txt | WA | 16 ms | 456 KB |
1
|
3
|
|
randM_02.txt | WA | 340 ms | 3996 KB |
1
|
3
|
|
randM_03.txt | WA | 329 ms | 5064 KB |
1
|
3
|
|
randM_04.txt | WA | 332 ms | 6136 KB |
1
|
3
|
|
randM_05.txt | WA | 328 ms | 7208 KB |
1
|
3
|
|
randS_01.txt | WA | 20 ms | 4572 KB |
1
|
2
|
3
|
randS_02.txt | WA | 22 ms | 4536 KB |
1
|
2
|
3
|
randS_03.txt | WA | 324 ms | 8072 KB |
1
|
2
|
3
|
randS_04.txt | WA | 324 ms | 9004 KB |
1
|
2
|
3
|
randS_05.txt | WA | 325 ms | 10068 KB |
1
|
2
|
3
|