Submission #00362


ソースコード

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
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
ll nex[400000],v[400000];
char ty[400000][2];
int main(){
int q;scanf("%d",&q);
rep(i,q){
int c;scanf("%d",&c);
if(c==1){
ll r;scanf("%lld%s%lld",&r,ty[i],&v[i]);r--;
if(i){
nex[i]=nex[r];nex[r]=i;
}
}
else{
ll s,l,t;scanf("%lld%lld%lld",&s,&l,&t);s--;
if(l>100)abort();
rep(j,l){
if(ty[s][0]=='A')t=min(t,(ll)v[s]);
else if(ty[s][0]=='B')t=max(t,(ll)v[s]);
else t+=v[s];
s=nex[s];
}
printf("%lld\n",t);
}
}
}

ステータス

項目 データ
問題 0006 - tubequery
ユーザー名 autumn_eel
投稿日時 2017-11-26 14:51:34
言語 C++11
状態 Runtime Error
得点 40
ソースコード長 603 Byte
最大実行時間 144 ms
最大メモリ使用量 13380 KB

セット

セット 得点 Cases
1 ALL 0 / 60 *
2 partial_1 20 / 20 !test_01.txt, *S*
3 partial_2 20 / 20 !*, *S*, *M*

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
!test_01.txt AC 18 ms 2528 KB
1
2
3
!test_02.txt AC 16 ms 2504 KB
1
3
cornL_01.txt RE 23 ms 420 KB
1
cornL_02.txt RE 27 ms 524 KB
1
cornS_01.txt AC 19 ms 2552 KB
1
2
3
cornS_02.txt AC 19 ms 2644 KB
1
2
3
hand_01.txt RE 27 ms 440 KB
1
hand_02.txt AC 20 ms 2596 KB
1
hand_03.txt RE 23 ms 520 KB
1
randL_01.txt RE 25 ms 492 KB
1
randL_02.txt RE 28 ms 2520 KB
1
randL_03.txt RE 29 ms 2488 KB
1
randL_04.txt RE 31 ms 2588 KB
1
randL_05.txt RE 29 ms 2440 KB
1
randL_06.txt RE 22 ms 2540 KB
1
randL_07.txt RE 26 ms 2636 KB
1
randL_08.txt RE 30 ms 560 KB
1
randL_09.txt RE 25 ms 536 KB
1
randL_10.txt RE 21 ms 2560 KB
1
randM_01.txt AC 18 ms 2540 KB
1
3
randM_02.txt AC 124 ms 7248 KB
1
3
randM_03.txt AC 137 ms 8384 KB
1
3
randM_04.txt AC 129 ms 9396 KB
1
3
randM_05.txt AC 144 ms 10408 KB
1
3
randS_01.txt AC 21 ms 6552 KB
1
2
3
randS_02.txt AC 17 ms 6780 KB
1
2
3
randS_03.txt AC 101 ms 11364 KB
1
2
3
randS_04.txt AC 103 ms 12372 KB
1
2
3
randS_05.txt AC 96 ms 13380 KB
1
2
3