제출 #1150106

#제출 시각아이디문제언어결과실행 시간메모리
1150106enzyParachute rings (IOI12_rings)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+10;
int n, resp, qtd3, viz[maxn], eh[manx];
vector<int>v[maxn];
bool ja=false;
void Init(int N_){
    resp = n = N_;
}

void Link(int a, int b){
    v[a].push_back(b);
    v[b].push_back(a);
    if(v[a].size()>=4){
        if(ja) resp=0;
        else if(qtd3==viz[a]+1) resp=1; // tem o proprio a
        ja=true;
    }
    if(v[b].size()>=4){
        if(ja) resp=0;
        else if(qtd3==viz[b]+1) resp=1; // tem o proprio b
        ja=true;
    }
    if(v[a].size()==3){
        qtd3++; eh[a]++;
        int at=0;
        for(int i : v[a]){
            viz[i]++;
            if(viz[i]+eh[i]==qtd3) at++;
        }
        resp=at;
    }
    if(v[b].size()==3){
        qtd3++; eh[b]++;
        int at=0;
        for(int i : v[b]){
            viz[i]++;
            if(viz[i]+eh[i]==qtd3) at++;
        }
        resp=at;
    }
}

int CountCritical(){
    return resp;
}

컴파일 시 표준 에러 (stderr) 메시지

rings.cpp:4:34: error: 'manx' was not declared in this scope; did you mean 'maxn'?
    4 | int n, resp, qtd3, viz[maxn], eh[manx];
      |                                  ^~~~
      |                                  maxn
rings.cpp: In function 'void Link(int, int)':
rings.cpp:25:17: error: 'eh' was not declared in this scope
   25 |         qtd3++; eh[a]++;
      |                 ^~
rings.cpp:34:17: error: 'eh' was not declared in this scope
   34 |         qtd3++; eh[b]++;
      |                 ^~