# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
596038 |
2022-07-14T09:28:28 Z |
AGE |
Sob (COCI19_sob) |
C++14 |
|
1000 ms |
293412 KB |
#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),adj[j].pb(i);
}
}
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
sob.cpp:37:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
37 | main()
| ^~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
52980 KB |
Output is correct |
2 |
Correct |
25 ms |
51860 KB |
Output is correct |
3 |
Correct |
24 ms |
49308 KB |
Output is correct |
4 |
Execution timed out |
1106 ms |
293412 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
73 ms |
55372 KB |
Output is correct |
2 |
Correct |
28 ms |
47364 KB |
Output is correct |
3 |
Correct |
25 ms |
47260 KB |
Output is correct |
4 |
Correct |
26 ms |
47248 KB |
Output is correct |
5 |
Correct |
25 ms |
47572 KB |
Output is correct |
6 |
Execution timed out |
1094 ms |
290720 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
22 ms |
47232 KB |
Output is correct |
2 |
Correct |
25 ms |
47316 KB |
Output is correct |
3 |
Correct |
23 ms |
47276 KB |
Output is correct |
4 |
Correct |
24 ms |
47444 KB |
Output is correct |
5 |
Correct |
24 ms |
47256 KB |
Output is correct |
6 |
Correct |
25 ms |
47572 KB |
Output is correct |
7 |
Correct |
25 ms |
47540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
52980 KB |
Output is correct |
2 |
Correct |
25 ms |
51860 KB |
Output is correct |
3 |
Correct |
24 ms |
49308 KB |
Output is correct |
4 |
Execution timed out |
1106 ms |
293412 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |