# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
19876 |
2016-02-25T06:30:34 Z |
gs14004 |
동전 (kriii4_E) |
C++14 |
|
23 ms |
1972 KB |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <functional>
#include <vector>
#include <numeric>
#include <deque>
#include <utility>
#include <bitset>
#include <iostream>
using namespace std;
typedef long long lint;
typedef long double llf;
typedef pair<int, int> pi;
const int mod = 1e9 + 7;
int dp[255][256];
int f(int x, int y){
if(x == 0) return y == 0;
if(~dp[x][y]) return dp[x][y];
int ret = f(x-1, y);
for(int i=1; i<x; i++){
ret += f(x-i - 1, y ^ i);
ret %= mod;
}
return dp[x][y] = ret;
}
int main(){
memset(dp, -1, sizeof(dp));
int n; cin >> n;
cout << f(n+1, 0);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1972 KB |
Output is correct |
2 |
Correct |
0 ms |
1972 KB |
Output is correct |
3 |
Correct |
0 ms |
1972 KB |
Output is correct |
4 |
Correct |
0 ms |
1972 KB |
Output is correct |
5 |
Correct |
0 ms |
1972 KB |
Output is correct |
6 |
Correct |
0 ms |
1972 KB |
Output is correct |
7 |
Correct |
0 ms |
1972 KB |
Output is correct |
8 |
Correct |
0 ms |
1972 KB |
Output is correct |
9 |
Correct |
0 ms |
1972 KB |
Output is correct |
10 |
Correct |
0 ms |
1972 KB |
Output is correct |
11 |
Correct |
0 ms |
1972 KB |
Output is correct |
12 |
Correct |
0 ms |
1972 KB |
Output is correct |
13 |
Correct |
0 ms |
1972 KB |
Output is correct |
14 |
Correct |
0 ms |
1972 KB |
Output is correct |
15 |
Correct |
0 ms |
1972 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
1972 KB |
Output is correct |
2 |
Correct |
7 ms |
1972 KB |
Output is correct |
3 |
Correct |
0 ms |
1972 KB |
Output is correct |
4 |
Correct |
0 ms |
1972 KB |
Output is correct |
5 |
Correct |
0 ms |
1972 KB |
Output is correct |
6 |
Correct |
0 ms |
1972 KB |
Output is correct |
7 |
Correct |
13 ms |
1972 KB |
Output is correct |
8 |
Correct |
18 ms |
1972 KB |
Output is correct |
9 |
Correct |
3 ms |
1972 KB |
Output is correct |
10 |
Correct |
16 ms |
1972 KB |
Output is correct |
11 |
Correct |
0 ms |
1972 KB |
Output is correct |
12 |
Correct |
0 ms |
1972 KB |
Output is correct |
13 |
Correct |
15 ms |
1972 KB |
Output is correct |
14 |
Correct |
8 ms |
1972 KB |
Output is correct |
15 |
Correct |
3 ms |
1972 KB |
Output is correct |
16 |
Correct |
0 ms |
1972 KB |
Output is correct |
17 |
Correct |
21 ms |
1972 KB |
Output is correct |
18 |
Correct |
0 ms |
1972 KB |
Output is correct |
19 |
Correct |
7 ms |
1972 KB |
Output is correct |
20 |
Correct |
0 ms |
1972 KB |
Output is correct |
21 |
Correct |
11 ms |
1972 KB |
Output is correct |
22 |
Correct |
8 ms |
1972 KB |
Output is correct |
23 |
Correct |
4 ms |
1972 KB |
Output is correct |
24 |
Correct |
2 ms |
1972 KB |
Output is correct |
25 |
Correct |
0 ms |
1972 KB |
Output is correct |
26 |
Correct |
0 ms |
1972 KB |
Output is correct |
27 |
Correct |
15 ms |
1972 KB |
Output is correct |
28 |
Correct |
0 ms |
1972 KB |
Output is correct |
29 |
Correct |
15 ms |
1972 KB |
Output is correct |
30 |
Correct |
23 ms |
1972 KB |
Output is correct |