Submission #39403

# Submission time Handle Problem Language Result Execution time Memory
39403 2018-01-14T04:00:10 Z adamczh1 Parachute rings (IOI12_rings) C++14
0 / 100
1137 ms 125836 KB
#include <bits/stdc++.h>
using namespace std;

int N;
int deg[1000000];

void Init(int N_) {
	N = N_;
}

set<int> adj[1000000];
set<int> s;

void Link(int A, int B) {
	adj[A].insert(B), adj[B].insert(A);
	deg[A]++, deg[B]++;
	if(deg[A]>2) s.insert(A);
	if(deg[B]>2) s.insert(B);
}

int CountCritical() {
	int res=0;
	for(int i=0;i<N;i++){
		int ok=1;
		for(int v:s){
			if(i!=v && adj[i].find(v)==adj[i].end()){
				ok=0;
				break;
			}
		}
		res+=ok;
	}
	return res;
}
# Verdict Execution time Memory Grader output
1 Correct 52 ms 47224 KB Output is correct
2 Incorrect 43 ms 47732 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 602 ms 98420 KB Output is correct
2 Incorrect 1137 ms 125836 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 52 ms 47224 KB Output is correct
2 Incorrect 43 ms 47732 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 52 ms 47224 KB Output is correct
2 Incorrect 43 ms 47732 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 52 ms 47224 KB Output is correct
2 Incorrect 43 ms 47732 KB Output isn't correct
3 Halted 0 ms 0 KB -