Submission #93531

#TimeUsernameProblemLanguageResultExecution timeMemory
93531Sa1loumNorela (info1cup18_norela)C++14
0 / 100
3 ms504 KiB
#include <bits/stdc++.h> using namespace std; #define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define mem(a,b) memset(a, b, sizeof(a)) #define F first #define S second #define Si size #define pb(x) push_back(x) typedef double D; typedef long long ll; typedef long double ld; const int MOD=(int)1e9+7,MAX=(int)1e5+10; int n,m,x,a[100],q[100][100],num[100]; string s; string to_strings__(int n){ string t; t.clear(); int x=10; while (n%x) { t+=(char)(n%x+'0'); n/=x; } reverse(t.begin(),t.end()); t+=" "; return t; } bool possible(int a[100],int i) { /* for (int k=0;k<num[i];k++) { a[q[i][k]]++; }*/ int p=1; for (int l=1;l<=n;l++) { if (a[l]%2==0) p=0; } if (p) return 1; for (int j=i;j<m;j++) { s+=to_strings__(j+1); for (int k=0;k<num[j];k++) { a[q[j][k]]++; } if (possible(a,j+1)) { return 1; } else { s.pop_back(); while (s[s.size()-1]!=' ') s.pop_back(); for (int k=0;k<num[j];k++) { a[q[j][k]]--; } } } return 0; } int main() { s.clear(); s+=" "; scanf("%d%d",&n,&m); for (int i=0;i<m;i++) { cin>>num[i]; for (int j=0;j<num[i];j++) { cin>>q[i][j]; } } for (int i=0;i<m;i++) { if (possible(a,i)) { cout<<s; return 0; } s.clear(); } }

Compilation message (stderr)

norela.cpp: In function 'int main()':
norela.cpp:59:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...