제출 #1313013

#제출 시각아이디문제언어결과실행 시간메모리
1313013neonglitchNorela (info1cup18_norela)C++20
0 / 100
2 ms4408 KiB
#include <iostream> #include <vector> using namespace std; typedef long long ll; #define int ll const int P=100,M=2e7; ll s[P],pw2[P]; ll fnl[M],cnt[M];; main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); pw2[0]=1; for(int i=1;i<62;i++)pw2[i]=pw2[i-1]*2ll; int n,m; cin>>n>>m; for(int i=0;i<m;i++) { int sz; cin>>sz; for(int j=0;j<sz;j++) { int x; cin>>x; x--; s[i]|=pw2[x]; } } int cn=m+200,ap=pw2[m]; for(int mk=1;mk<pw2[m];mk++) { int x=(mk&-mk); fnl[mk]=(fnl[mk-x]^s[__lg(x)]); cnt[mk]=(cnt[mk-x]+1); if(fnl[mk]==(pw2[n]-1)) { int cc=cnt[mk]; mk^=(pw2[m]-1); if(cc<cn) { cn=cc; ap=mk; } else if (cc==cn and mk>ap){ ap=mk; } mk^=(pw2[m]-1); } } cout<<cn<<endl; ap^=(pw2[m]-1); for(int i=0;i<m;i++) { if((ap>>i)&1) { cout<<i+1<<' '; } } cout<<endl; }

컴파일 시 표준 에러 (stderr) 메시지

norela.cpp:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    9 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...