Task: | jedan |
Sender: | siirikuoppala |
Submission time: | 2016-08-02 17:27:21 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.05 s | details |
#2 | ACCEPTED | 0.06 s | details |
#3 | WRONG ANSWER | 0.06 s | details |
#4 | ACCEPTED | 0.06 s | details |
#5 | ACCEPTED | 0.06 s | details |
#6 | WRONG ANSWER | 0.06 s | details |
#7 | ACCEPTED | 0.06 s | details |
#8 | WRONG ANSWER | 0.06 s | details |
#9 | WRONG ANSWER | 0.06 s | details |
#10 | WRONG ANSWER | 0.06 s | details |
#11 | WRONG ANSWER | 0.05 s | details |
#12 | WRONG ANSWER | 0.06 s | details |
#13 | WRONG ANSWER | 0.06 s | details |
#14 | ACCEPTED | 0.05 s | details |
#15 | ACCEPTED | 0.06 s | details |
#16 | WRONG ANSWER | 0.06 s | details |
#17 | WRONG ANSWER | 0.06 s | details |
#18 | WRONG ANSWER | 0.06 s | details |
#19 | WRONG ANSWER | 0.05 s | details |
#20 | WRONG ANSWER | 0.06 s | details |
#21 | WRONG ANSWER | 0.07 s | details |
#22 | WRONG ANSWER | 0.06 s | details |
#23 | ACCEPTED | 0.06 s | details |
#24 | ACCEPTED | 0.06 s | details |
#25 | WRONG ANSWER | 0.08 s | details |
#26 | WRONG ANSWER | 0.08 s | details |
#27 | WRONG ANSWER | 0.15 s | details |
#28 | WRONG ANSWER | 0.20 s | details |
#29 | WRONG ANSWER | 0.22 s | details |
#30 | WRONG ANSWER | 0.30 s | details |
#31 | WRONG ANSWER | 0.31 s | details |
#32 | WRONG ANSWER | 0.31 s | details |
#33 | WRONG ANSWER | 0.32 s | details |
#34 | WRONG ANSWER | 0.21 s | details |
#35 | WRONG ANSWER | 0.21 s | details |
#36 | WRONG ANSWER | 0.27 s | details |
#37 | WRONG ANSWER | 0.23 s | details |
#38 | ACCEPTED | 0.32 s | details |
Code
#include <iostream> using namespace std; typedef long long ll; #define M 1000000007 ll t[10101], s[10101]; int A[10101]; int main(){ int n; cin >> n; for(int i=0; i<n; ++i){ cin >> A[i]; } if(A[0]==-1) A[0]=0; t[0]=1; for(int i=1; i<n; ++i){ int h=A[i-1]+1; if(A[i]!=-1){ int u=A[i]; s[u]= t[u]+t[u+1]; if(u>0) t[u]+=t[u-1]; t[u]%=M; continue; }else{ for(int j=0; j<=h; ++j){ if(j>0) s[j]+= t[j-1]; s[j]+=t[j]; s[j]+=t[j+1]; s[j]%=M; } A[i]=h; } for(int i=0; i<10001; ++i){ t[i]=s[i]; s[i]=0; } } cout << t[0]; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
3
-1 2 -1 |
correct output |
---|
0 |
user output |
---|
1 |
Test 2
Verdict: ACCEPTED
input |
---|
3
-1 -1 -1 |
correct output |
---|
2 |
user output |
---|
2 |
Test 3
Verdict: WRONG ANSWER
input |
---|
6
-1 -1 -1 2 -1 -1 |
correct output |
---|
3 |
user output |
---|
11 |
Test 4
Verdict: ACCEPTED
input |
---|
1
-1 |
correct output |
---|
1 |
user output |
---|
1 |
Test 5
Verdict: ACCEPTED
input |
---|
1
0 |
correct output |
---|
1 |
user output |
---|
1 |
Test 6
Verdict: WRONG ANSWER
input |
---|
1
1 |
correct output |
---|
0 |
user output |
---|
1 |
Test 7
Verdict: ACCEPTED
input |
---|
15
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... |
correct output |
---|
113634 |
user output |
---|
113634 |
Test 8
Verdict: WRONG ANSWER
input |
---|
30
-1 -1 -1 -1 -1 -1 -1 -1 7 -1 -... |
correct output |
---|
33792 |
user output |
---|
658935913 |
Test 9
Verdict: WRONG ANSWER
input |
---|
40
-1 -1 -1 -1 -1 -1 -1 6 -1 -1 -... |
correct output |
---|
44058168 |
user output |
---|
983620955 |
Test 10
Verdict: WRONG ANSWER
input |
---|
50
-1 -1 -1 -1 4 -1 -1 -1 -1 -1 -... |
correct output |
---|
885261321 |
user output |
---|
821156489 |
Test 11
Verdict: WRONG ANSWER
input |
---|
100
-1 -1 -1 -1 -1 -1 -1 -1 7 -1 -... |
correct output |
---|
630105363 |
user output |
---|
905186820 |
Test 12
Verdict: WRONG ANSWER
input |
---|
200
0 -1 -1 -1 4 -1 -1 -1 -1 0 -1 ... |
correct output |
---|
584749136 |
user output |
---|
455892239 |
Test 13
Verdict: WRONG ANSWER
input |
---|
300
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -... |
correct output |
---|
440962689 |
user output |
---|
843361226 |
Test 14
Verdict: ACCEPTED
input |
---|
500
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... |
correct output |
---|
861085225 |
user output |
---|
861085225 |
Test 15
Verdict: ACCEPTED
input |
---|
499
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... |
correct output |
---|
686858355 |
user output |
---|
686858355 |
Test 16
Verdict: WRONG ANSWER
input |
---|
500
0 0 -1 -1 -1 3 -1 -1 -1 6 6 -1... |
correct output |
---|
287620623 |
user output |
---|
860590719 |
Test 17
Verdict: WRONG ANSWER
input |
---|
500
0 -1 -1 1 -1 0 -1 0 -1 -1 3 -1... |
correct output |
---|
132437565 |
user output |
---|
975445445 |
Test 18
Verdict: WRONG ANSWER
input |
---|
500
0 -1 1 -1 2 2 -1 4 -1 -1 -1 1 ... |
correct output |
---|
545015067 |
user output |
---|
102963862 |
Test 19
Verdict: WRONG ANSWER
input |
---|
500
-1 1 1 -1 1 -1 1 -1 -1 1 -1 -1... |
correct output |
---|
394701022 |
user output |
---|
427434506 |
Test 20
Verdict: WRONG ANSWER
input |
---|
500
0 -1 -1 2 -1 -1 -1 -1 -1 -1 -1... |
correct output |
---|
287409105 |
user output |
---|
168920294 |
Test 21
Verdict: WRONG ANSWER
input |
---|
500
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -... |
correct output |
---|
455719894 |
user output |
---|
557196745 |
Test 22
Verdict: WRONG ANSWER
input |
---|
500
-1 1 -1 -1 -1 -1 -1 -1 -1 -1 -... |
correct output |
---|
174226870 |
user output |
---|
861085225 |
Test 23
Verdict: ACCEPTED
input |
---|
500
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... |
correct output |
---|
861085225 |
user output |
---|
861085225 |
Test 24
Verdict: ACCEPTED
input |
---|
1000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... |
correct output |
---|
812718674 |
user output |
---|
812718674 |
Test 25
Verdict: WRONG ANSWER
input |
---|
2000
-1 1 -1 -1 -1 -1 -1 -1 -1 -1 -... |
correct output |
---|
93994771 |
user output |
---|
921019137 |
Test 26
Verdict: WRONG ANSWER
input |
---|
3000
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -... |
correct output |
---|
335231082 |
user output |
---|
666472665 |
Test 27
Verdict: WRONG ANSWER
input |
---|
5000
0 -1 2 -1 1 2 -1 -1 5 -1 -1 7 ... |
correct output |
---|
799295101 |
user output |
---|
613317290 |
Test 28
Verdict: WRONG ANSWER
input |
---|
7000
0 -1 0 0 -1 0 -1 1 0 1 0 0 -1 ... |
correct output |
---|
436287141 |
user output |
---|
691461668 |
Test 29
Verdict: WRONG ANSWER
input |
---|
8000
0 -1 1 -1 3 -1 1 -1 1 0 -1 -1 ... |
correct output |
---|
88524447 |
user output |
---|
491363823 |
Test 30
Verdict: WRONG ANSWER
input |
---|
10000
0 0 1 -1 -1 3 2 -1 3 -1 4 -1 5... |
correct output |
---|
129950957 |
user output |
---|
177940247 |
Test 31
Verdict: WRONG ANSWER
input |
---|
10000
-1 0 -1 -1 3 2 -1 -1 -1 -1 1 -... |
correct output |
---|
598246902 |
user output |
---|
634464127 |
Test 32
Verdict: WRONG ANSWER
input |
---|
10000
-1 1 0 -1 2 1 -1 1 -1 0 -1 -1 ... |
correct output |
---|
105842640 |
user output |
---|
292365655 |
Test 33
Verdict: WRONG ANSWER
input |
---|
10000
0 -1 0 -1 -1 -1 4 3 -1 -1 -1 -... |
correct output |
---|
133310608 |
user output |
---|
978722894 |
Test 34
Verdict: WRONG ANSWER
input |
---|
10000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... |
correct output |
---|
484205143 |
user output |
---|
881117565 |
Test 35
Verdict: WRONG ANSWER
input |
---|
10000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... |
correct output |
---|
904817827 |
user output |
---|
316405740 |
Test 36
Verdict: WRONG ANSWER
input |
---|
10000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... |
correct output |
---|
966971895 |
user output |
---|
335841133 |
Test 37
Verdict: WRONG ANSWER
input |
---|
10000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... |
correct output |
---|
664825423 |
user output |
---|
808688140 |
Test 38
Verdict: ACCEPTED
input |
---|
10000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... |
correct output |
---|
681928184 |
user output |
---|
681928184 |