Contest Duration: - (local time) (100 minutes) Back to Home

Submission #854957

Source Code Expand

Copy
```#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;

ll dp[51][51][251];

int main(){
int N, A;
cin >> N >> A;
vi x(N);
rep(i, N)scanf("%d", &x[i]);

dp[0][0][0] = 1;
rep(i, N)rep(j, N)rep(k, 251){
ll y = dp[i][j][k];
if(y == 0)continue;
dp[i + 1][j + 1][k + x[i]] += y;
dp[i + 1][j][k] += y;
}

ll ans = 0;
FOR(n, 1, N + 1)rep(sm, 251){
if(sm%n == 0 && sm / n == A){
ans += dp[N][n][sm];
}
}
cout << ans << endl;
}```

#### Submission Info

Submission Time 2016-08-28 21:06:01+0900 C - Tak and Cards paruki C++14 (GCC 5.4.1) 0 1016 Byte WA 11 ms 3328 KB

#### Compile Error

```./Main.cpp: In function ‘int main()’:
./Main.cpp:24:32: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
rep(i, N)scanf("%d", &x[i]);
^
```

#### Judge Result

Score / Max Score 0 / 0 0 / 200 0 / 100
Status
 AC × 4
 AC × 8 WA × 4
 AC × 12 WA × 12
Set Name Test Cases
Sample example_01.txt, example_02.txt, example_03.txt, example_04.txt
Case Name Status Exec Time Memory
example_01.txt AC 4 ms 256 KB
example_02.txt AC 5 ms 256 KB
example_03.txt AC 4 ms 384 KB
example_04.txt AC 7 ms 1408 KB
subtask1_01.txt WA 5 ms 640 KB
subtask1_02.txt WA 5 ms 640 KB
subtask1_03.txt AC 4 ms 640 KB
subtask1_04.txt AC 5 ms 512 KB
subtask1_05.txt WA 5 ms 640 KB
subtask1_06.txt AC 4 ms 256 KB
subtask1_07.txt AC 4 ms 256 KB
subtask1_08.txt WA 5 ms 640 KB
subtask1_09.txt AC 5 ms 512 KB
subtask2_01.txt WA 10 ms 3072 KB
subtask2_02.txt WA 11 ms 3072 KB
subtask2_03.txt WA 11 ms 3072 KB
subtask2_04.txt WA 11 ms 3328 KB
subtask2_05.txt WA 10 ms 3328 KB
subtask2_06.txt AC 11 ms 2944 KB
subtask2_07.txt AC 10 ms 3072 KB
subtask2_08.txt WA 7 ms 1536 KB
subtask2_09.txt AC 7 ms 1536 KB
subtask2_10.txt WA 8 ms 2176 KB
subtask2_11.txt WA 10 ms 2304 KB