Submission #00359
ソースコード
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 | #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 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; if (R != cou - 1) { return 0; } ts.push_back({ type,v }); ++cou; } else { LL S, L, v; in >> S >> L >> v; for (LL i = S - 1; i < S - 1 + L; ++i) { auto tubb = ts[i]; 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 14:50:53 |
言語 | C++17 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 837 Byte |
最大実行時間 | 41 ms |
最大メモリ使用量 | 632 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 | 24 ms | 480 KB |
1
|
2
|
3
|
!test_02.txt | WA | 13 ms | 456 KB |
1
|
3
|
|
cornL_01.txt | RE | 41 ms | 556 KB |
1
|
||
cornL_02.txt | RE | 26 ms | 536 KB |
1
|
||
cornS_01.txt | WA | 16 ms | 516 KB |
1
|
2
|
3
|
cornS_02.txt | WA | 17 ms | 492 KB |
1
|
2
|
3
|
hand_01.txt | RE | 27 ms | 596 KB |
1
|
||
hand_02.txt | WA | 18 ms | 576 KB |
1
|
||
hand_03.txt | RE | 21 ms | 560 KB |
1
|
||
randL_01.txt | RE | 29 ms | 540 KB |
1
|
||
randL_02.txt | WA | 21 ms | 516 KB |
1
|
||
randL_03.txt | WA | 14 ms | 492 KB |
1
|
||
randL_04.txt | WA | 15 ms | 468 KB |
1
|
||
randL_05.txt | WA | 21 ms | 448 KB |
1
|
||
randL_06.txt | WA | 16 ms | 432 KB |
1
|
||
randL_07.txt | WA | 13 ms | 536 KB |
1
|
||
randL_08.txt | RE | 20 ms | 516 KB |
1
|
||
randL_09.txt | RE | 20 ms | 496 KB |
1
|
||
randL_10.txt | WA | 16 ms | 604 KB |
1
|
||
randM_01.txt | WA | 14 ms | 456 KB |
1
|
3
|
|
randM_02.txt | WA | 13 ms | 436 KB |
1
|
3
|
|
randM_03.txt | WA | 16 ms | 420 KB |
1
|
3
|
|
randM_04.txt | WA | 19 ms | 528 KB |
1
|
3
|
|
randM_05.txt | WA | 24 ms | 632 KB |
1
|
3
|
|
randS_01.txt | WA | 16 ms | 484 KB |
1
|
2
|
3
|
randS_02.txt | WA | 13 ms | 464 KB |
1
|
2
|
3
|
randS_03.txt | WA | 17 ms | 568 KB |
1
|
2
|
3
|
randS_04.txt | WA | 17 ms | 544 KB |
1
|
2
|
3
|
randS_05.txt | WA | 16 ms | 392 KB |
1
|
2
|
3
|