이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
long long count_tastiness(long long x, vector<long long> a) {
const int N= 100001;
int k= a.size();
long long dp[N]= {0};
dp[0]= 1;
for (int i= 0; i< k; i++) {
long long cnt= (1<< i);
for (int kk= 0; kk< N; kk++) {
if (dp[kk]==(i+ 1)) {
for (int j= 1; j<= a[i]; j++){
if(dp[kk+ (j* cnt)]== 0)
dp[kk+ (j* cnt)]= i+ 2;
}
}
}
}
long long an= 0;
for (int i= 0; i< N; i++) if (dp[i]) an++;
return an;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |