Submission #00382


ソースコード

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
#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--;
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 15:02:36
言語 C++11
状態 Time Limit Exceeded
得点 40
ソースコード長 581 Byte
最大実行時間 1000 ms
最大メモリ使用量 13372 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 17 ms 2528 KB
1
2
3
!test_02.txt AC 21 ms 2752 KB
1
3
cornL_01.txt TLE 1000 ms 2600 KB
1
cornL_02.txt TLE 1000 ms 2576 KB
1
cornS_01.txt AC 19 ms 2676 KB
1
2
3
cornS_02.txt AC 17 ms 2648 KB
1
2
3
hand_01.txt TLE 1000 ms 2620 KB
1
hand_02.txt AC 19 ms 2468 KB
1
hand_03.txt TLE 1000 ms 2568 KB
1
randL_01.txt TLE 1000 ms 2540 KB
1
randL_02.txt TLE 1000 ms 2512 KB
1
randL_03.txt TLE 1000 ms 2612 KB
1
randL_04.txt TLE 1000 ms 2456 KB
1
randL_05.txt TLE 1000 ms 2428 KB
1
randL_06.txt TLE 1000 ms 2532 KB
1
randL_07.txt TLE 1000 ms 2380 KB
1
randL_08.txt TLE 1000 ms 2608 KB
1
randL_09.txt TLE 1000 ms 2584 KB
1
randL_10.txt TLE 1000 ms 2564 KB
1
randM_01.txt AC 18 ms 2532 KB
1
3
randM_02.txt AC 135 ms 7240 KB
1
3
randM_03.txt AC 124 ms 8252 KB
1
3
randM_04.txt AC 126 ms 9256 KB
1
3
randM_05.txt AC 123 ms 10268 KB
1
3
randS_01.txt AC 15 ms 6540 KB
1
2
3
randS_02.txt AC 21 ms 6640 KB
1
2
3
randS_03.txt AC 99 ms 11472 KB
1
2
3
randS_04.txt AC 101 ms 12360 KB
1
2
3
randS_05.txt AC 97 ms 13372 KB
1
2
3