이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
long long int count_tastiness(long long int x,vector<long long int> a){
int Total=a.size();
for(int i=Total;i<60;i++){
a.push_back(0);
}
vector<pair<long long int,long long int>> answer={make_pair(0,1)};
long long int Count=0;
for(int i=0;i<60;i++){
vector<pair<long long int,long long int>> tmp;
for(int j=0;j<(int)answer.size();j++){
if(answer[j].first-x+a[i]>=0){
tmp.push_back(make_pair((answer[j].first-x+a[i])/2,answer[j].second));
}
tmp.push_back(make_pair((answer[j].first+a[i])/2,answer[j].second));
}
sort(tmp.begin(),tmp.end());
answer.clear();
long long int tmp_num=0;
long long int now=tmp[0].first;
tmp.push_back(make_pair(-1,0));
for(int j=0;j<(int)tmp.size();j++){
if(tmp[j].first!=now){
answer.push_back(make_pair(tmp[j-1].first,tmp_num));
tmp_num=tmp[j].second;
now=tmp[j].first;
}
else tmp_num+=tmp[j].second;
}
}
for(int j=0;j<(int)answer.size();j++){
Count+=answer[j].second;
}
return Count;
}
# | 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... |