Submission #00163
ソースコード
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 | #include<bits/stdc++.h> using namespace std; int ans[3333]={0}; int main(){ int n,q,a,b,c,e; long long h; int w[3333],p[3333],d[3333]; cin >> n >> q; cin >> a >> b; for ( int i=n-1;i>=0;i--){ cin >> w[i] >> p[i] >> d[i]; } for ( int j=0;j<b-a;j++){ c=a; c+=j; e=0; for ( int i=0; i<n && ans[j]<q; i++){ if (d[i]==1 && w[i]+q >= c){ ans[j]+=p[i]; e=ans[j]; c=c-p[i]; } else if (d[i]==2){ ans[j]+=p[i]; e=ans[j]; } else if (d[i]==3 && w[i]-q <= c){ e=ans[j]; c=c+p[i]; } } } for ( int i=0;i<b-a;i++){ cout << ans[i] << endl; } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0004 - 生存環境シミュレート |
ユーザー名 | yuu |
投稿日時 | 2016-05-14 16:29:59 |
言語 | C++11 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 661 Byte |
最大実行時間 | 48 ms |
最大メモリ使用量 | 744 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 7 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in1.txt | WA | 18 ms | 476 KB |
1
|
in2.txt | WA | 10 ms | 500 KB |
1
|
in3.txt | WA | 19 ms | 592 KB |
1
|
in4.txt | WA | 17 ms | 668 KB |
1
|
in5.txt | WA | 17 ms | 484 KB |
1
|
in6.txt | WA | 17 ms | 680 KB |
1
|
in7.txt | WA | 24 ms | 620 KB |
1
|
in8.txt | WA | 48 ms | 688 KB |
1
|
in9.txt | WA | 10 ms | 744 KB |
1
|
in10.txt | WA | 30 ms | 696 KB |
1
|