# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
400751 | 2021-05-08T15:45:28 Z | REALITYNB | 비스킷 담기 (IOI20_biscuits) | C++14 | 9 ms | 364 KB |
#include <bits/stdc++.h> #include "biscuits.h" #define int long long using namespace std; int count_tastiness(int k,vector<int> a){ int n =120 ; while(n!=a.size()) a.push_back(0) ; vector<int> dp(n+1); dp[n]=1; for(int i=n-1;i>-1;i--){ int sum = 0 ; vector<int> b=a; int stop = i+1; for(int j=i;j<n;j++){ if(b[j]>1){ b[j+1]+=b[j]/2; if(b[j]&1) b[j]=1; else b[j]=0; stop=j+2; } else break ; } if(a[i]==0) { dp[i]+=dp[i+1] ; continue ; } vector<int> in ; for(int j=i;j<stop;j++) if(b[j]) in.push_back(j) ; for(int j=1;j<in.size();j++) dp[i]+=dp[stop]*(1LL<<(in[j-1]-i)); dp[i]+=dp[stop]; dp[i]+=dp[stop]*(1LL<<(in.back()-i)) ; } return dp[0] ; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Incorrect | 1 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 292 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 292 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 9 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Incorrect | 1 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |