| Task: | Contests |
| Sender: | >--) ) ) )*> |
| Submission time: | 2015-10-07 18:47:50 +0300 |
| Language: | C++ |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.07 s | details |
| #2 | WRONG ANSWER | 0.07 s | details |
| #3 | TIME LIMIT EXCEEDED | -- | details |
| #4 | TIME LIMIT EXCEEDED | -- | details |
| #5 | WRONG ANSWER | 0.06 s | details |
| #6 | TIME LIMIT EXCEEDED | -- | details |
| #7 | TIME LIMIT EXCEEDED | -- | details |
| #8 | TIME LIMIT EXCEEDED | -- | details |
| #9 | WRONG ANSWER | 0.06 s | details |
| #10 | TIME LIMIT EXCEEDED | -- | details |
| #11 | TIME LIMIT EXCEEDED | -- | details |
| #12 | TIME LIMIT EXCEEDED | -- | details |
| #13 | WRONG ANSWER | 0.16 s | details |
| #14 | TIME LIMIT EXCEEDED | -- | details |
| #15 | RUNTIME ERROR | 0.16 s | details |
| #16 | WRONG ANSWER | 0.05 s | details |
| #17 | RUNTIME ERROR | 0.16 s | details |
| #18 | TIME LIMIT EXCEEDED | -- | details |
| #19 | TIME LIMIT EXCEEDED | -- | details |
| #20 | TIME LIMIT EXCEEDED | -- | details |
Code
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <bitset>
#include <cmath>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <map>
#include <set>
using namespace std;
#define ll long long
#define ld long double
#define ii pair<int,int>
#define si pair<string,int>
#define iii pair<int,ii>
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define msvs map<string,vs>
#define msi map<string,int>
#define mss map<string,int>
#define us unordered_set
#define um unordered_map
#define pq priority_queue
#define pb push_back
#define mp make_pair
#define forall(i,a,b) for (int i=a;i<b;i++)
#define foreach(v,c) for( typeof( (c).begin()) v = (c).begin(); v != (c).end(); ++v)
#define all(a) a.begin(), a.end()
#define in(a,b) ( (b).find(a) != (b).end())
#define fill(a,v) memset(a, v, sizeof a)
#define sz(a) ((int)(a.size()))
#define N (1<<17)
#define M 1000000007
#define I 500000004
ll d[2000][2000];
ll f(int a, int b) {
if (a/b > 10) return 0;
if (a <= 10) return d[a+b-1][b-1]%M;
ll sum = 0;
for (int i = 0; i <= 10; i++) {
sum = (sum%M+f(a-i,b-1)%M)%M;
sum %= M;
}
return sum%M;
}
int main()
{
for (int i = 0; i < 2000; i++) {
d[i][0] = 1;
for (int j = 1; j <= i; j++) {
d[i][j] = (d[i-1][j-1]+d[i-1][j-1])%M;
d[i][j] %= M;
}
}
int n,s;
cin >> n >> s;
int x = 0;
int y = 0;
for (int i = 0; i < n; i++) {
char a; cin >> a;
if (a == '?') x++;
else y += a - '0';
}
int z = s - y;
cout << f(z,x) << "\n";
}
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 |
|---|
| 0 |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 100 741 1 6 ? 7 2 ? 5 1 2 3 10 ? ? 5 4... |
| correct output |
|---|
| 598236954 |
| user output |
|---|
| 0 |
Test 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 25 83 ? 5 4 7 9 ? 3 ? ? 4 3 5 ? ? ? ... |
| correct output |
|---|
| 77504288 |
| user output |
|---|
| (empty) |
Test 4
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 729 8 5 5 2 9 ? 2 ? ? 1 5 ? ? 9 ? ... |
| correct output |
|---|
| 579081161 |
| user output |
|---|
| (empty) |
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 3 11 7 ? ? |
| correct output |
|---|
| 5 |
| user output |
|---|
| 2 |
Test 6
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 423 ? ? ? ? ? 3 ? 6 ? 2 ? ? 9 1 5 ... |
| correct output |
|---|
| 73043117 |
| user output |
|---|
| (empty) |
Test 7
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 706 3 ? 9 ? ? ? ? ? ? 9 ? 1 ? 1 5 ... |
| correct output |
|---|
| 169594458 |
| user output |
|---|
| (empty) |
Test 8
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 719 10 ? 2 ? 8 ? ? 4 7 ? 1 ? ? ? ?... |
| correct output |
|---|
| 371478559 |
| user output |
|---|
| (empty) |
Test 9
Verdict: WRONG ANSWER
| input |
|---|
| 75 545 9 ? 9 ? 10 9 9 1 5 ? 2 ? 5 9 4... |
| correct output |
|---|
| 189257897 |
| user output |
|---|
| 0 |
Test 10
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 661 ? 8 ? 8 10 ? ? 5 ? 5 10 ? ? 1 ... |
| correct output |
|---|
| 589662095 |
| user output |
|---|
| (empty) |
Test 11
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 32 172 ? ? ? ? ? ? 7 8 ? ? 9 ? ? 1 7 ... |
| correct output |
|---|
| 319164449 |
| user output |
|---|
| (empty) |
Test 12
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 580 8 ? 9 ? ? 6 4 ? ? ? 6 ? ? 4 ? ... |
| correct output |
|---|
| 671479185 |
| user output |
|---|
| (empty) |
Test 13
Verdict: WRONG ANSWER
| input |
|---|
| 96 724 1 ? ? ? 7 ? ? ? 10 ? ? 7 2 ? 8... |
| correct output |
|---|
| 627075870 |
| user output |
|---|
| 0 |
Test 14
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 289 4 ? 9 ? 6 ? ? 2 ? ? 1 8 ? ? ? ... |
| correct output |
|---|
| 672526186 |
| user output |
|---|
| (empty) |
Test 15
Verdict: RUNTIME ERROR
| input |
|---|
| 12 0 0 0 0 0 0 0 0 0 0 0 0 0 |
| correct output |
|---|
| 1 |
| user output |
|---|
| (empty) |
Test 16
Verdict: WRONG ANSWER
| input |
|---|
| 100 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ... |
| correct output |
|---|
| 1 |
| user output |
|---|
| 988185646 |
Test 17
Verdict: RUNTIME ERROR
| input |
|---|
| 70 700 10 10 10 10 10 10 10 10 10 10 ... |
| correct output |
|---|
| 1 |
| user output |
|---|
| (empty) |
Test 18
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 1000 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ... |
| correct output |
|---|
| 1 |
| user output |
|---|
| (empty) |
Test 19
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 57 213 ? ? 8 ? ? ? 10 1 1 8 ? ? 6 5 4... |
| correct output |
|---|
| 843378101 |
| user output |
|---|
| (empty) |
Test 20
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 306 ? 10 ? ? ? 10 6 ? ? ? 3 7 1 ? ... |
| correct output |
|---|
| 646826362 |
| user output |
|---|
| (empty) |
