Submission #1005490

# Submission time Handle Problem Language Result Execution time Memory
1005490 2024-06-22T13:46:51 Z vjudge1 Party (POI11_imp) C++17
27 / 100
31 ms 1372 KB
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
bool v[1006][1006],r[1006];
int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        ll x,y;
        cin>>x>>y;
        v[x-1][y-1]=1;
    }
    for(int i=0;i<n;i++){
        if(r[i])continue;
        for(int j=i+1;j<n;j++){
            if(r[j])continue;
            if(!v[i][j]){
                r[i]=1;r[j]=1;
                break;
            }
        }
    }
    ll x=n/3;
    for(int i=0;i<n;i++){
        if(x==0)break;
        if(!r[i]){
            x--;
            cout<<i+1<<" ";
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 8 ms 960 KB Output is correct
3 Correct 8 ms 860 KB Output is correct
4 Correct 8 ms 860 KB Output is correct
5 Correct 8 ms 956 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 856 KB Output is correct
2 Correct 30 ms 1372 KB Output is correct
3 Correct 30 ms 1272 KB Output is correct
4 Correct 31 ms 1372 KB Output is correct
5 Correct 30 ms 1372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 856 KB Output is correct
2 Runtime error 1 ms 604 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 23 ms 1116 KB Output is correct
2 Runtime error 1 ms 600 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -