Submission #597026

# Submission time Handle Problem Language Result Execution time Memory
597026 2022-07-15T11:58:48 Z DJ035 Party (POI11_imp) C++17
100 / 100
779 ms 65536 KB
#include <bits/stdc++.h>
#define MEM 3003
#define sanic ios_base::sync_with_stdio(0)
#define pf push_front
#define pb push_back
#define all(v) v.begin(), v.end()
#define sz size()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pi;
const ll INF = 2e18;
const ll MOD = 998244353;
ll n,m,k;
ll a[MEM][MEM], p[MEM];
signed main(){
    sanic; cin.tie(0);
    cin >> n >> m;
    for(int i=0; i<m; i++){
        ll q1,q2;
        cin >> q1 >> q2;
        if(q1>q2) swap(q1,q2);
        a[q1][q2] = 1;
    }
    for(int i=1; i<=n; i++)
        for(int j=i+1; j<=n; j++){
            if(a[i][j]) continue;
            if(p[i]+p[j]) continue;
            p[i] = p[j] = 1;
        }
    ll o=0;
    for(int i=1; i<=n; i++){
        o += p[i]^1;
        if(p[i]^1) cout << i << ' ';
        if(o==n/3) break;
    }
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 468 KB Output is correct
3 Correct 1 ms 724 KB Output is correct
4 Correct 1 ms 724 KB Output is correct
5 Correct 1 ms 720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1364 KB Output is correct
2 Correct 19 ms 3788 KB Output is correct
3 Correct 13 ms 3796 KB Output is correct
4 Correct 16 ms 3796 KB Output is correct
5 Correct 13 ms 3784 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 2900 KB Output is correct
2 Correct 69 ms 8816 KB Output is correct
3 Correct 71 ms 8908 KB Output is correct
4 Correct 66 ms 8880 KB Output is correct
5 Correct 62 ms 8780 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 21 ms 4564 KB Output is correct
2 Correct 174 ms 15980 KB Output is correct
3 Correct 178 ms 15928 KB Output is correct
4 Correct 173 ms 15900 KB Output is correct
5 Correct 177 ms 15960 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 62 ms 7560 KB Output is correct
2 Correct 261 ms 21012 KB Output is correct
3 Correct 261 ms 20924 KB Output is correct
4 Correct 257 ms 21028 KB Output is correct
5 Correct 270 ms 21040 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 141 ms 15704 KB Output is correct
2 Correct 346 ms 24672 KB Output is correct
3 Correct 330 ms 24720 KB Output is correct
4 Correct 359 ms 24696 KB Output is correct
5 Correct 336 ms 24776 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 346 ms 24568 KB Output is correct
2 Correct 459 ms 30888 KB Output is correct
3 Correct 449 ms 31152 KB Output is correct
4 Correct 450 ms 30968 KB Output is correct
5 Correct 454 ms 31044 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 412 ms 30828 KB Output is correct
2 Correct 537 ms 35432 KB Output is correct
3 Correct 545 ms 35608 KB Output is correct
4 Correct 554 ms 35596 KB Output is correct
5 Correct 544 ms 35576 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 461 ms 34812 KB Output is correct
2 Correct 618 ms 40256 KB Output is correct
3 Correct 675 ms 40276 KB Output is correct
4 Correct 639 ms 40392 KB Output is correct
5 Correct 619 ms 40336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 563 ms 39440 KB Output is correct
2 Correct 714 ms 45016 KB Output is correct
3 Correct 771 ms 45032 KB Output is correct
4 Correct 724 ms 44840 KB Output is correct
5 Correct 720 ms 44988 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 681 ms 46660 KB Output is correct
2 Correct 755 ms 47176 KB Output is correct
3 Correct 761 ms 59952 KB Output is correct
4 Correct 770 ms 65536 KB Output is correct
5 Correct 779 ms 65536 KB Output is correct