Submission #596033

#TimeUsernameProblemLanguageResultExecution timeMemory
596033AGESob (COCI19_sob)C++14
39 / 110
1099 ms201616 KiB
#include<bits/stdc++.h> #define F first #define S second #define pb push_back #define int long long using namespace std; const int N=2e6+10,M=2e3,mod=10; int vis[N],cnt=1,mt[N]; vector<int>adj[N]; bool trykuhn(int node){ if(vis[node]==cnt) return 0; vis[node]=cnt; for(auto x:adj[node]){ if(mt[x]==-1){ mt[x]=node; return 1; } } for(auto x:adj[node]){ if(trykuhn(mt[x])){ mt[x]=node;return 1; } } return 0; } main() { int n,m; cin>>n>>m; for(int i=0;i<n;i++){ for(int j=m;j<n+m;j++){ if((i&j)==i) adj[i].pb(j); } } for(int i=0;i<n+m;i++) mt[i]=-1; for(int i=0;i<n;i++){ trykuhn(i),cnt++; } for(int i=0;i<n;i++) cout<<mt[i+m]<<" "<<i+m<<endl; return 0; }

Compilation message (stderr)

sob.cpp:37:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   37 | 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...