# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
18667 | suhgyuho_william | Parachute rings (IOI12_rings) | C++98 | 4101 ms | 40872 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <vector>
using namespace std;
int N;
vector<int> edge[1000010];
void Init(int N_) {
N = N_;
}
void Link(int A, int B) {
A++; B++;
edge[A].push_back(B);
edge[B].push_back(A);
}
int j;
bool check[1000010],flag;
void dfs(int x,int par){
int i,v,cnt = 0;
check[x] = true;
for(i=0; i<edge[x].size(); i++){
v = edge[x][i];
if(v == par || v == j) continue;
if(check[v]){ flag = false; continue; }
dfs(v,x);
cnt++;
if(cnt == 2){
flag = false;
break;
}
}
}
int CountCritical() {
int i,cnt = 0,t,v;
for(j=1; j<=N; j++){
for(i=1; i<=N; i++) check[i] = false;
flag = true; check[j] = true;
for(i=1; i<=N; i++){
if(!check[i]){
t = 0;
for(int k=0; k<edge[i].size(); k++){
v = edge[i][k];
if(v == j) continue;
t++;
if(t == 3){
flag = false;
break;
}
dfs(v,i);
}
}
if(!flag) break;
}
if(flag) cnt++;
}
return cnt;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |