Submission #00128


ソースコード

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
53
54
55
56
57
58
59
60
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n;
cin>>n;
long long dp1[n] = {};
long long dp2[n] = {};
long long d[n];
for(long long i = 0;i < n;i++) cin>>d[i];
if(d[0] < 10){
cout<<"no\n";
return(0);
}
dp1[0] = d[0];
for(long long i = 1;i < n;i++){
dp1[i] = dp1[i-1] - 10;
if(dp1[i] < 0){
cout<<"no\n";
return(0);
}
if(d[i] >= 10) dp1[i] += d[i];
//dp1[i] -= dp1[i]%10;
//cout<<dp1[i]<<"\n";
if(dp1[i] < 10){
cout<<"no\n";
return(0);
}
}
if(d[n-1] < 10){
cout<<"no\n";
return(0);
}
dp2[n-1] = d[n-1];
//cout<<"-------------\n";
for(long long i = n-2;i >= 0;i--){
dp2[i] = dp2[i+1] - 10;
if(dp2[i] < 0){
cout<<"no\n";
return(0);
}
if(d[i] >= 10) dp2[i] += d[i];
//dp2[i] -= dp2[i]%10;
//cout<<dp2[i]<<"\n";
if(dp2[i] < 10){
cout<<"no\n";
return(0);
}
}
cout<<"yes\n";
}

ステータス

項目 データ
問題 0006 - トランポリン
ユーザー名 r2213
投稿日時 2023-07-31 11:35:54
言語 C++17
状態 Wrong Answer
得点 0
ソースコード長 1188 Byte
最大実行時間 85 ms
最大メモリ使用量 7728 KB

セット

セット 得点 Cases
1 ALL 0 / 11 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in1.txt AC 17 ms 604 KB
1
in2.txt AC 17 ms 540 KB
1
in3.txt AC 17 ms 456 KB
1
in4.txt AC 20 ms 652 KB
1
in5.txt AC 22 ms 604 KB
1
in6.txt AC 22 ms 576 KB
1
in7.txt AC 18 ms 548 KB
1
in8.txt AC 54 ms 7564 KB
1
in9.txt AC 52 ms 7552 KB
1
in10.txt AC 85 ms 7612 KB
1
in11.txt AC 16 ms 560 KB
1
in12.txt AC 22 ms 652 KB
1
in13.txt WA 24 ms 624 KB
1
in14.txt AC 17 ms 592 KB
1
in15.txt AC 24 ms 564 KB
1
in16.txt AC 26 ms 532 KB
1
in17.txt WA 25 ms 500 KB
1
in18.txt AC 21 ms 472 KB
1
in19.txt AC 18 ms 448 KB
1
in20.txt AC 14 ms 508 KB
1
in21.txt AC 21 ms 476 KB
1
in22.txt AC 20 ms 576 KB
1
in23.txt AC 23 ms 552 KB
1
in24.txt AC 20 ms 528 KB
1
in25.txt AC 20 ms 632 KB
1
in26.txt AC 20 ms 604 KB
1
in27.txt AC 22 ms 708 KB
1
in28.txt AC 24 ms 712 KB
1
in29.txt AC 27 ms 840 KB
1
in30.txt AC 20 ms 688 KB
1
in31.txt AC 30 ms 2868 KB
1
in32.txt AC 67 ms 7668 KB
1
in33.txt AC 65 ms 7656 KB
1
in34.txt AC 66 ms 7640 KB
1
in35.txt AC 73 ms 7628 KB
1
in36.txt AC 81 ms 7612 KB
1
in37.txt AC 66 ms 7728 KB
1
in38.txt AC 62 ms 7720 KB
1
in39.txt AC 57 ms 7700 KB
1
in40.txt WA 65 ms 7656 KB
1