Task: | Contests |
Sender: | Team Purkka |
Submission time: | 2015-10-07 17:19:47 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.05 s | details |
#2 | WRONG ANSWER | 0.04 s | details |
#3 | WRONG ANSWER | 0.05 s | details |
#4 | WRONG ANSWER | 0.05 s | details |
#5 | ACCEPTED | 0.06 s | details |
#6 | WRONG ANSWER | 0.06 s | details |
#7 | WRONG ANSWER | 0.05 s | details |
#8 | WRONG ANSWER | 0.06 s | details |
#9 | WRONG ANSWER | 0.05 s | details |
#10 | WRONG ANSWER | 0.06 s | details |
#11 | WRONG ANSWER | 0.05 s | details |
#12 | WRONG ANSWER | 0.05 s | details |
#13 | WRONG ANSWER | 0.06 s | details |
#14 | WRONG ANSWER | 0.05 s | details |
#15 | ACCEPTED | 0.05 s | details |
#16 | ACCEPTED | 0.06 s | details |
#17 | ACCEPTED | 0.04 s | details |
#18 | ACCEPTED | 0.05 s | details |
#19 | WRONG ANSWER | 0.06 s | details |
#20 | WRONG ANSWER | 0.06 s | details |
Code
#include <iostream> #include <vector> #include <algorithm> #include <queue> using namespace std; int c[101][1001]; int g(int s,int n); int f(int s,int n){ if(s==0)return 1; if(s<0)return 0; if(n==0)return 0; if(s>10*n)return 0; int t=0; for(int i=0;i<=10;i++){ t=(t+g(s-i,n-1))%1000000007; } return t; } int g(int s,int n){ if(c[n][s]==-1){ c[n][s]=f(s,n); } return c[n][s]; } int main() { cin.sync_with_stdio(false); for (int i =0;i<=100;i++){ for(int j=0;j<=1000;j++){ c[i][j]=-1; } } int n,s; cin>>n>>s; for(int i=0;i<n;i++){ string l; cin>>l; if(l!="?"){ n--; if(l=="10")s-=10; else s-=l[0]-'0'; } } cout<<g(s,n)<<endl; return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
100 722 10 ? 8 ? 8 5 1 3 ? 2 5 3 1 ? ?... |
correct output |
---|
55143150 |
user output |
---|
728290201 |
Test 2
Verdict: WRONG ANSWER
input |
---|
100 741 1 6 ? 7 2 ? 5 1 2 3 10 ? ? 5 4... |
correct output |
---|
598236954 |
user output |
---|
427536063 |
Test 3
Verdict: WRONG ANSWER
input |
---|
25 83 ? 5 4 7 9 ? 3 ? ? 4 3 5 ? ? ? ... |
correct output |
---|
77504288 |
user output |
---|
870291417 |
Test 4
Verdict: WRONG ANSWER
input |
---|
100 729 8 5 5 2 9 ? 2 ? ? 1 5 ? ? 9 ? ... |
correct output |
---|
579081161 |
user output |
---|
934176550 |
Test 5
Verdict: ACCEPTED
input |
---|
3 11 7 ? ? |
correct output |
---|
5 |
user output |
---|
5 |
Test 6
Verdict: WRONG ANSWER
input |
---|
100 423 ? ? ? ? ? 3 ? 6 ? 2 ? ? 9 1 5 ... |
correct output |
---|
73043117 |
user output |
---|
470597963 |
Test 7
Verdict: WRONG ANSWER
input |
---|
100 706 3 ? 9 ? ? ? ? ? ? 9 ? 1 ? 1 5 ... |
correct output |
---|
169594458 |
user output |
---|
819779601 |
Test 8
Verdict: WRONG ANSWER
input |
---|
100 719 10 ? 2 ? 8 ? ? 4 7 ? 1 ? ? ? ?... |
correct output |
---|
371478559 |
user output |
---|
593917171 |
Test 9
Verdict: WRONG ANSWER
input |
---|
75 545 9 ? 9 ? 10 9 9 1 5 ? 2 ? 5 9 4... |
correct output |
---|
189257897 |
user output |
---|
403016386 |
Test 10
Verdict: WRONG ANSWER
input |
---|
100 661 ? 8 ? 8 10 ? ? 5 ? 5 10 ? ? 1 ... |
correct output |
---|
589662095 |
user output |
---|
73467176 |
Test 11
Verdict: WRONG ANSWER
input |
---|
32 172 ? ? ? ? ? ? 7 8 ? ? 9 ? ? 1 7 ... |
correct output |
---|
319164449 |
user output |
---|
625550312 |
Test 12
Verdict: WRONG ANSWER
input |
---|
100 580 8 ? 9 ? ? 6 4 ? ? ? 6 ? ? 4 ? ... |
correct output |
---|
671479185 |
user output |
---|
735519913 |
Test 13
Verdict: WRONG ANSWER
input |
---|
96 724 1 ? ? ? 7 ? ? ? 10 ? ? 7 2 ? 8... |
correct output |
---|
627075870 |
user output |
---|
718582112 |
Test 14
Verdict: WRONG ANSWER
input |
---|
100 289 4 ? 9 ? 6 ? ? 2 ? ? 1 8 ? ? ? ... |
correct output |
---|
672526186 |
user output |
---|
704224221 |
Test 15
Verdict: ACCEPTED
input |
---|
12 0 0 0 0 0 0 0 0 0 0 0 0 0 |
correct output |
---|
1 |
user output |
---|
1 |
Test 16
Verdict: ACCEPTED
input |
---|
100 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ... |
correct output |
---|
1 |
user output |
---|
1 |
Test 17
Verdict: ACCEPTED
input |
---|
70 700 10 10 10 10 10 10 10 10 10 10 ... |
correct output |
---|
1 |
user output |
---|
1 |
Test 18
Verdict: ACCEPTED
input |
---|
100 1000 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ... |
correct output |
---|
1 |
user output |
---|
1 |
Test 19
Verdict: WRONG ANSWER
input |
---|
57 213 ? ? 8 ? ? ? 10 1 1 8 ? ? 6 5 4... |
correct output |
---|
843378101 |
user output |
---|
836560944 |
Test 20
Verdict: WRONG ANSWER
input |
---|
100 306 ? 10 ? ? ? 10 6 ? ? ? 3 7 1 ? ... |
correct output |
---|
646826362 |
user output |
---|
187341660 |