Submission #597024

# Submission time Handle Problem Language Result Execution time Memory
597024 2022-07-15T11:57:29 Z DJ035 Party (POI11_imp) C++17
90 / 100
855 ms 65596 KB
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#include <bits/stdc++.h>
#define MEM 3333
#define sanic ios_base::sync_with_stdio(0)
#define x first
#define y second
#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 0 ms 340 KB Output is correct
2 Correct 1 ms 468 KB Output is correct
3 Correct 1 ms 728 KB Output is correct
4 Correct 1 ms 724 KB Output is correct
5 Correct 1 ms 724 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 1200 KB Output is correct
2 Correct 13 ms 4020 KB Output is correct
3 Correct 13 ms 3924 KB Output is correct
4 Correct 13 ms 3924 KB Output is correct
5 Correct 14 ms 3992 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 2540 KB Output is correct
2 Correct 77 ms 11212 KB Output is correct
3 Correct 58 ms 11064 KB Output is correct
4 Correct 59 ms 11148 KB Output is correct
5 Correct 57 ms 11128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 4152 KB Output is correct
2 Correct 187 ms 22364 KB Output is correct
3 Correct 157 ms 22236 KB Output is correct
4 Correct 173 ms 22264 KB Output is correct
5 Correct 156 ms 22356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 7124 KB Output is correct
2 Correct 244 ms 30936 KB Output is correct
3 Correct 255 ms 30780 KB Output is correct
4 Correct 283 ms 30840 KB Output is correct
5 Correct 272 ms 30940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 139 ms 15052 KB Output is correct
2 Correct 341 ms 37432 KB Output is correct
3 Correct 336 ms 37208 KB Output is correct
4 Correct 329 ms 37324 KB Output is correct
5 Correct 343 ms 37332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 305 ms 24024 KB Output is correct
2 Correct 457 ms 48616 KB Output is correct
3 Correct 456 ms 48080 KB Output is correct
4 Correct 449 ms 48280 KB Output is correct
5 Correct 440 ms 48340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 414 ms 30136 KB Output is correct
2 Correct 534 ms 56492 KB Output is correct
3 Correct 535 ms 56108 KB Output is correct
4 Correct 540 ms 56280 KB Output is correct
5 Correct 529 ms 56212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 479 ms 34728 KB Output is correct
2 Correct 614 ms 65364 KB Output is correct
3 Correct 629 ms 64900 KB Output is correct
4 Correct 622 ms 65080 KB Output is correct
5 Correct 611 ms 64864 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 530 ms 39744 KB Output is correct
2 Correct 727 ms 65536 KB Output is correct
3 Correct 726 ms 65536 KB Output is correct
4 Correct 729 ms 65536 KB Output is correct
5 Correct 705 ms 65536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 672 ms 47400 KB Output is correct
2 Correct 820 ms 65536 KB Output is correct
3 Runtime error 855 ms 65596 KB Memory limit exceeded
4 Halted 0 ms 0 KB -