Submission #119198

# Submission time Handle Problem Language Result Execution time Memory
119198 2019-06-20T16:01:49 Z ioilolcom Parachute rings (IOI12_rings) C++14
0 / 100
4000 ms 98096 KB
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
int N;
const int M=1e6+7;
set<int> adj[M];
int deg[M];
void Init(int N_) {
	N = N_;
}

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

int CountCritical() {
	int ans=0;
	for(int i=0; i<N; i++) {
		int tmp=deg[i];

		deg[i]=0;
		for(int j=0; j<N; j++) {
			if(adj[i].count(j)) {
				deg[j]--;
			}
		}
		bool lol=false;
		for(int j=0; j<N; j++) {
			if(deg[j]>=3) {
				lol=true;
				break;
			}
		}
		deg[i]=tmp;
		for(int v:adj[i]) {
			deg[v]++;
		}
		ans+=(!lol);
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 42 ms 47352 KB Output is correct
2 Correct 89 ms 47956 KB Output is correct
3 Correct 100 ms 47864 KB Output is correct
4 Incorrect 45 ms 47352 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4014 ms 98096 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 42 ms 47352 KB Output is correct
2 Correct 89 ms 47956 KB Output is correct
3 Correct 100 ms 47864 KB Output is correct
4 Incorrect 45 ms 47352 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 42 ms 47352 KB Output is correct
2 Correct 89 ms 47956 KB Output is correct
3 Correct 100 ms 47864 KB Output is correct
4 Incorrect 45 ms 47352 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 42 ms 47352 KB Output is correct
2 Correct 89 ms 47956 KB Output is correct
3 Correct 100 ms 47864 KB Output is correct
4 Incorrect 45 ms 47352 KB Output isn't correct
5 Halted 0 ms 0 KB -