답안 #328620

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
328620 2020-11-17T11:07:54 Z Vladth11 Party (POI11_imp) C++14
100 / 100
2133 ms 33340 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define debug(x) cerr << #x << " " << x << "\n"
#define debug_with_space(x) cerr << #x << " " << x << " "

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair <ll, ll> pii;
typedef pair <ll, pii> piii;
typedef tree <pii, null_type, less <pii>, rb_tree_tag, tree_order_statistics_node_update> OST;

const ll NMAX = 200001;
const ll INF = (1 << 16) - 1;
const ll MOD = 1000000007;
const ll BLOCK = 101;
const ll nr_of_bits = 20;

bitset <3001> b[3001];
vector <int> sol;
vector <int> v[3001];
int ok[3001];
queue <int> q;

int main() {
    int n, m, i;
    cin >> n >> m;
    for(i = 1; i <= m; i++) {
        int x, y;
        cin >> x >> y;
        b[x][y].flip();
        b[y][x].flip();
    }
    for(i = 1; i <= n; i++) {
        ok[i] = 1;
    }
    for(int i = 1; i <= n; i++){
        for(int j = i + 1; j <= n; j++){
            if(!b[i][j] && ok[i] && ok[j]){
                ok[i] = 0;
                ok[j] = 0;
            }
        }
    }
    int cc = n / 3;
    for(int i = 1; i <= n && cc; i++){
        if(ok[i]){
            cout << i << " ";
            cc--;
        }
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 2 ms 492 KB Output is correct
4 Correct 2 ms 492 KB Output is correct
5 Correct 2 ms 492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 492 KB Output is correct
2 Correct 47 ms 1004 KB Output is correct
3 Correct 48 ms 1260 KB Output is correct
4 Correct 44 ms 1384 KB Output is correct
5 Correct 44 ms 1260 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 492 KB Output is correct
2 Correct 178 ms 2156 KB Output is correct
3 Correct 178 ms 3692 KB Output is correct
4 Correct 186 ms 3692 KB Output is correct
5 Correct 183 ms 3760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 58 ms 620 KB Output is correct
2 Correct 437 ms 2364 KB Output is correct
3 Correct 454 ms 8168 KB Output is correct
4 Correct 460 ms 8172 KB Output is correct
5 Correct 437 ms 8428 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 133 ms 780 KB Output is correct
2 Correct 633 ms 2540 KB Output is correct
3 Correct 646 ms 11884 KB Output is correct
4 Correct 635 ms 12012 KB Output is correct
5 Correct 635 ms 12140 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 379 ms 1004 KB Output is correct
2 Correct 793 ms 2596 KB Output is correct
3 Correct 783 ms 14844 KB Output is correct
4 Correct 794 ms 14956 KB Output is correct
5 Correct 786 ms 14828 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 753 ms 1260 KB Output is correct
2 Correct 1137 ms 1516 KB Output is correct
3 Correct 1091 ms 19212 KB Output is correct
4 Correct 1114 ms 19340 KB Output is correct
5 Correct 1122 ms 19436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 969 ms 1292 KB Output is correct
2 Correct 1446 ms 1416 KB Output is correct
3 Correct 1397 ms 22760 KB Output is correct
4 Correct 1421 ms 22904 KB Output is correct
5 Correct 1408 ms 22888 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1201 ms 1368 KB Output is correct
2 Correct 1592 ms 1508 KB Output is correct
3 Correct 1716 ms 26656 KB Output is correct
4 Correct 1633 ms 26960 KB Output is correct
5 Correct 1648 ms 26732 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1423 ms 1440 KB Output is correct
2 Correct 1852 ms 1620 KB Output is correct
3 Correct 1855 ms 30732 KB Output is correct
4 Correct 1934 ms 31164 KB Output is correct
5 Correct 1896 ms 31004 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1825 ms 1548 KB Output is correct
2 Correct 1999 ms 1620 KB Output is correct
3 Correct 2109 ms 33004 KB Output is correct
4 Correct 2133 ms 33340 KB Output is correct
5 Correct 2114 ms 33228 KB Output is correct