Submission #1225421
Source Code Expand
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; int main() { int N; cin >> N; vector<vector<int>> dp(N+1, vector<int>(6*N+1, 0)); dp[0][0] = 1; for(int i=0; i<N; ++i) { for(int j=1; j<=6; ++j) { for(int k=6*N-j; k>=0; --k) { dp[i+1][k+j] += dp[i][k]; } } } int res = 0; for(int i=0; i<6*N+1; ++i) { if(dp[N][res] < dp[N][i]) { res = i; } } cout << res << endl; }
Submission Info
Submission Time | |
---|---|
Task | B - ダイスゲーム |
User | Suibaka |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 559 Byte |
Status | WA |
Exec Time | 4 ms |
Memory | 1792 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt, sample-03.txt |
All | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 1 ms | 256 KB |
01-02.txt | AC | 1 ms | 256 KB |
01-03.txt | AC | 1 ms | 256 KB |
01-04.txt | AC | 1 ms | 256 KB |
01-05.txt | AC | 1 ms | 256 KB |
01-06.txt | AC | 1 ms | 256 KB |
01-07.txt | AC | 1 ms | 256 KB |
01-08.txt | WA | 4 ms | 1792 KB |
01-09.txt | WA | 4 ms | 1792 KB |
01-10.txt | WA | 2 ms | 640 KB |
01-11.txt | WA | 1 ms | 384 KB |
01-12.txt | WA | 2 ms | 1152 KB |
01-13.txt | WA | 2 ms | 640 KB |
sample-01.txt | AC | 1 ms | 256 KB |
sample-02.txt | AC | 1 ms | 256 KB |
sample-03.txt | AC | 1 ms | 256 KB |