# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
248995 | 2020-07-13T22:24:38 Z | blacktulip | Norela (info1cup18_norela) | C++17 | 800 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; typedef long long lo; typedef pair< lo,lo > PII; #define fi first #define se second #define mp make_pair #define endl "\n" #define pb push_back #define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define FOR for(int i=1;i<=n;i++) #define mid ((start+end)/2) #define ort ((bas+son)/2) const lo inf = 1000000000000000000; const lo KOK = 100000; const lo LOG = 30; const lo li = 65; const lo mod = 1000000007; int n,m,b[li],a[li][li],k,flag,t,no[li],l[li]; int cev; string s; vector<int> mini; inline void f(int sira,int mask){ if(sira>m){ for(int i=1;i<=n;i++)no[i]=0; for(int i=0;i<m;i++){ if((mask&(1<<i))==0)continue; for(int j=1;j<=l[i];j++){ no[a[i][j]]++; } } flag=0; FOR{ if(no[i]%2==0)flag=1; } vector<int> v; if(flag==1)return ; for(int i=0;i<m;i++){ if((mask&(1<<i))==0)continue; v.pb(i+1); } //~ sort(v.begin(),v.end()); if((int)v.size()<(int)mini.size()){swap(mini,v);return ;} if((int)v.size()>(int)mini.size()){return ;} if(mini>v)swap(mini,v); return ; } f(sira+1,mask); f(sira+1,(mask|(1<<sira))); } int main(void){ scanf("%d %d",&n,&m); for(int i=1;i<=m;i++)mini.pb(1000000); for(int i=0;i<m;i++){ scanf("%d",&l[i]); for(int j=1;j<=l[i];j++)scanf("%d",&a[i][j]); } f(0,0); printf("%d\n",(int)mini.size()); for(int i=0;i<(int)mini.size();i++){ printf("%d ",mini[i]); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 244 ms | 368 KB | Output is correct |
2 | Correct | 324 ms | 376 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 231 ms | 384 KB | Output is correct |
5 | Correct | 244 ms | 256 KB | Output is correct |
6 | Correct | 229 ms | 368 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 244 ms | 368 KB | Output is correct |
2 | Correct | 324 ms | 376 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 231 ms | 384 KB | Output is correct |
5 | Correct | 244 ms | 256 KB | Output is correct |
6 | Correct | 229 ms | 368 KB | Output is correct |
7 | Execution timed out | 1089 ms | 256 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 244 ms | 368 KB | Output is correct |
2 | Correct | 324 ms | 376 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 231 ms | 384 KB | Output is correct |
5 | Correct | 244 ms | 256 KB | Output is correct |
6 | Correct | 229 ms | 368 KB | Output is correct |
7 | Execution timed out | 1089 ms | 256 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 244 ms | 368 KB | Output is correct |
2 | Correct | 324 ms | 376 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 231 ms | 384 KB | Output is correct |
5 | Correct | 244 ms | 256 KB | Output is correct |
6 | Correct | 229 ms | 368 KB | Output is correct |
7 | Execution timed out | 1089 ms | 256 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |