Submission #00373
ソースコード
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 | #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; ts.push_back({ type,v }); } else { LL S, L, v; in >> S >> L >> v; for (LL i = S - 1; i < 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 14:55:40 |
言語 | C++17 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 800 Byte |
最大実行時間 | 1000 ms |
最大メモリ使用量 | 9400 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 | 16 ms | 480 KB |
1
|
2
|
3
|
!test_02.txt | WA | 20 ms | 464 KB |
1
|
3
|
|
cornL_01.txt | TLE | 1000 ms | 444 KB |
1
|
||
cornL_02.txt | TLE | 1000 ms | 416 KB |
1
|
||
cornS_01.txt | WA | 19 ms | 520 KB |
1
|
2
|
3
|
cornS_02.txt | WA | 15 ms | 620 KB |
1
|
2
|
3
|
hand_01.txt | TLE | 1000 ms | 588 KB |
1
|
||
hand_02.txt | AC | 18 ms | 440 KB |
1
|
||
hand_03.txt | TLE | 1000 ms | 544 KB |
1
|
||
randL_01.txt | TLE | 1000 ms | 524 KB |
1
|
||
randL_02.txt | TLE | 1000 ms | 504 KB |
1
|
||
randL_03.txt | TLE | 1000 ms | 612 KB |
1
|
||
randL_04.txt | TLE | 1000 ms | 588 KB |
1
|
||
randL_05.txt | TLE | 1000 ms | 700 KB |
1
|
||
randL_06.txt | TLE | 1000 ms | 544 KB |
1
|
||
randL_07.txt | TLE | 1000 ms | 524 KB |
1
|
||
randL_08.txt | TLE | 1000 ms | 496 KB |
1
|
||
randL_09.txt | TLE | 1000 ms | 476 KB |
1
|
||
randL_10.txt | TLE | 1000 ms | 452 KB |
1
|
||
randM_01.txt | WA | 11 ms | 436 KB |
1
|
3
|
|
randM_02.txt | WA | 322 ms | 3340 KB |
1
|
3
|
|
randM_03.txt | WA | 330 ms | 4304 KB |
1
|
3
|
|
randM_04.txt | WA | 332 ms | 5388 KB |
1
|
3
|
|
randM_05.txt | WA | 325 ms | 6220 KB |
1
|
3
|
|
randS_01.txt | WA | 17 ms | 4492 KB |
1
|
2
|
3
|
randS_02.txt | WA | 19 ms | 4596 KB |
1
|
2
|
3
|
randS_03.txt | WA | 338 ms | 7372 KB |
1
|
2
|
3
|
randS_04.txt | WA | 388 ms | 8324 KB |
1
|
2
|
3
|
randS_05.txt | WA | 323 ms | 9400 KB |
1
|
2
|
3
|