# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
494599 | reni | Bootfall (IZhO17_bootfall) | C++14 | 52 ms | 720 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#define endl '\n'
using namespace std;
long long a[10000000]={1}, b[10000];
bool used[1000000];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long m,s,n,i,j, last=0, br=30000;
cin>>n;
for(i=0;i<n;i++)
{
cin>>b[i];
for(j=last;j>=0;j--)
{
if(a[j]) a[j+b[i]]+=a[j];
last=max(last,j+b[i]);
}
}
if(last%2 || !a[last/2]){cout<<0<<endl;return 0;}
for(i=0;i<n;i++)
{
last-=b[i];
for(j=0;j<=last;j++)
{
if(a[j])a[j+b[i]]-=a[j];
}
for(j=1;j<=30000;j++)
{
if(a[(j+last)/2]==0 || (j+last)%2==1)
{
if(!used[j])br--;used[j]=1;
}
}
for(j=last;j>=0;j--)
{
if(a[j]) a[j+b[i]]+=a[j];
}
last+=b[i];
}
cout<<br<<endl;
for(j=1;j<=30000;j++)
{
if(!used[j])cout<<j<<" ";
}
cout<<endl;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |