제출 #1128093

#제출 시각아이디문제언어결과실행 시간메모리
1128093icecreamBootfall (IZhO17_bootfall)C++20
0 / 100
1 ms328 KiB
// アイスクリーム #include <bits/stdc++.h> #ifndef alks #pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt") #endif #pragma GCC optimize("O3,unroll-loops") #define ll long long #define int ll #define Yes cout<<"YES\n"; return; #define No cout<<"NO\n"; return; #define yes cout<<"Yes\n"; return; #define no cout<<"No\n"; return; #define wrans cout<<"-1\n"; return; using namespace std; const int N=250500; const int M=1e6+100; const int mod1=998244353; const int mod=1e9+7; const int INF=1e18; const long double eps=1e-12; const string ab="abcdefghijklmnopqrstuvwxyz"; const string AB="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int n; int a[N]; bool dp[N]; void alikosh(){ cin>>n; int sum=0; for(int i=1;i<=n;i++){ cin>>a[i]; sum+=a[i]; } vector <int> v; for(int x=1;x<=500;x++){ a[n+1]=x; bool ok=0; for(int i=1;i<=n+1;i++){ int y=sum+x-a[i]; if(y & 1){ ok=1; } for(int j=0;j<=y;j++){ dp[j]=0; } dp[0]=1; for(int j=1;j<=n+1;j++){ if(i==j){ continue; } for(int s=y;s>=a[j];s--){ if(dp[s-a[j]]){ dp[s]=1; } } } if(!dp[y/2]){ ok=1; break; } } if(!ok){ v.push_back(x); } } cout<<v.size()<<"\n"; for(int i:v){ cout<<i<<' '; } } signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int alikosh1=1; // cin>>alikosh1; for(int i=1;i<=alikosh1;i++){ // cout<<"Case "<<i<<": "; alikosh(); } } //, Ice \ \
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...