답안 #434052

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
434052 2021-06-20T14:30:06 Z aris12345678 낙하산 고리들 (IOI12_rings) C++14
0 / 100
4000 ms 42112 KB
#include <bits/stdc++.h>
using namespace std;

const int mxN = 1000005;
vector<int> adj[mxN];
int neib[mxN], n;

void Init(int size) {
    n = size;
}

void Link(int a, int b) {
    adj[a].push_back(b);
    adj[b].push_back(a);
    neib[a]++, neib[b]++;
}

int CountCritical() {
    int ans = 0;
    for(int i = 0; i < n; i++) {
        for(auto &v : adj[i])
            neib[v]--;
        bool ok = true;
        for(int j = 0; j < n; j++) {
            if(i == j) continue;
            if(neib[j] > 2) {
                ok = false;
                break;
            }
        }
        for(auto &v : adj[i])
            neib[v]++;
        if(ok)
            ans++;
    }
    return ans;
}

/*
int main() {
    scanf("%d", &n);
    Init(n);
    int q;
    scanf("%d", &q);
    while(q--) {
        int type, a, b;
        scanf("%d", &type);
        if(type == 1) {
            scanf("%d %d", &a, &b);
            Link(a, b);
        } else
            printf("%d\n", CountCritical());
    }
    return 0;
}
*/
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23756 KB Output is correct
2 Correct 30 ms 23968 KB Output is correct
3 Correct 22 ms 23976 KB Output is correct
4 Incorrect 17 ms 23756 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 4041 ms 42112 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23756 KB Output is correct
2 Correct 30 ms 23968 KB Output is correct
3 Correct 22 ms 23976 KB Output is correct
4 Incorrect 17 ms 23756 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23756 KB Output is correct
2 Correct 30 ms 23968 KB Output is correct
3 Correct 22 ms 23976 KB Output is correct
4 Incorrect 17 ms 23756 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 23756 KB Output is correct
2 Correct 30 ms 23968 KB Output is correct
3 Correct 22 ms 23976 KB Output is correct
4 Incorrect 17 ms 23756 KB Output isn't correct
5 Halted 0 ms 0 KB -