Submission #1150106

#TimeUsernameProblemLanguageResultExecution timeMemory
1150106enzy낙하산 고리들 (IOI12_rings)C++20
Compilation error
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; }

Compilation message (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]++;
      |                 ^~