Submission #19876

#TimeUsernameProblemLanguageResultExecution timeMemory
19876gs14004동전 (kriii4_E)C++14
100 / 100
23 ms1972 KiB
#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); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...