Submission #596033

# Submission time Handle Problem Language Result Execution time Memory
596033 2022-07-14T09:25:28 Z AGE Sob (COCI19_sob) C++14
39 / 110
1000 ms 201616 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);
        }
    }

    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 35 ms 52948 KB Output is correct
2 Correct 25 ms 51788 KB Output is correct
3 Correct 26 ms 49404 KB Output is correct
4 Execution timed out 1097 ms 201616 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 64 ms 51364 KB Output is correct
2 Correct 33 ms 47280 KB Output is correct
3 Correct 30 ms 47276 KB Output is correct
4 Correct 30 ms 47280 KB Output is correct
5 Correct 32 ms 47428 KB Output is correct
6 Execution timed out 1099 ms 200224 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 25 ms 47188 KB Output is correct
2 Correct 26 ms 47280 KB Output is correct
3 Correct 27 ms 47316 KB Output is correct
4 Correct 29 ms 47268 KB Output is correct
5 Correct 27 ms 47272 KB Output is correct
6 Correct 27 ms 47440 KB Output is correct
7 Correct 34 ms 47436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 52948 KB Output is correct
2 Correct 25 ms 51788 KB Output is correct
3 Correct 26 ms 49404 KB Output is correct
4 Execution timed out 1097 ms 201616 KB Time limit exceeded
5 Halted 0 ms 0 KB -