답안 #1110148

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1110148 2024-11-08T20:52:24 Z ozner77 낙하산 고리들 (IOI12_rings) C++17
0 / 100
1802 ms 262144 KB
#include <bits/stdc++.h>
using namespace std;
map<long long,long long> sumas;
vector<vector<int>> V;
long long con1=0;
int n;
bool caca=false;
void Init(int N){
    n=N;
    vector<int> V1(N,0);
    for(int i=0;i<N;i++){
        V.push_back(V1);
    }
}
void Link(int A,int B){
    caca=true;
    V[A][B]=1;
    V[B][A]=1;
    sumas[A]++;
    sumas[B]++;
}
int CountCritical(){
    if(caca){
    long long res=0;
    for(int i=0;i<n;i++){
        bool com=true;
        long long con=0;
        long long solitos=0;
        for(int j=0;j<n;j++){
            if(i!=j){
                if(V[i][j]==1){
                    sumas[j]--;
                }
                if(sumas[j]>2){
                    com=false;
                    break;
                }
                if(sumas[j]==0){
                    solitos++;
                    if(V[i][j]==1){
                        sumas[j]++;
                    }
                    continue;
                }
                if(sumas[j]==1){
                    con++;
                }
                if(V[i][j]==1){
                    sumas[j]++;
                }
            }
        }
        if(solitos!=n-1){
            if(con%2!=0 || con==0){
                com=false;
            }
        }
        if(com){
            res++;
        }
    }
    return res;
    }else{
        return n;
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 336 KB Output is correct
2 Correct 1802 ms 69288 KB Output is correct
3 Correct 220 ms 98692 KB Output is correct
4 Incorrect 95 ms 4432 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 182 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 336 KB Output is correct
2 Correct 1802 ms 69288 KB Output is correct
3 Correct 220 ms 98692 KB Output is correct
4 Incorrect 95 ms 4432 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 336 KB Output is correct
2 Correct 1802 ms 69288 KB Output is correct
3 Correct 220 ms 98692 KB Output is correct
4 Incorrect 95 ms 4432 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 336 KB Output is correct
2 Correct 1802 ms 69288 KB Output is correct
3 Correct 220 ms 98692 KB Output is correct
4 Incorrect 95 ms 4432 KB Output isn't correct
5 Halted 0 ms 0 KB -