#include <bits/stdc++.h>
#ifndef EVAL
#include "grader.cpp"
#endif
using namespace std;
#define lol long long
#define pii pair<int,int>
#define OK puts("OK");
#define NO puts("NO");
#define YES puts("YES");
#define fr first
#define sc second
#define ret return
#define scanl(a) scanf("%lld",&a);
#define scanll(a,b) scanf("%lld %lld",&a, &b);
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
#define scan1(a) scanf("%d",&a);
#define scan2(a,b) scanf("%d %d",&a, &b);
#define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define all(s) s.begin(),s.end()
#define allr(s) s.rbegin(),s.rend()
#define pb push_back
#define sz(v) (int)v.size()
#define endi puts("");
#define eps 1e-12
const int NN = 3e5+12,INF=1e9+7;
vector <int> g[NN];
int N,M,vis[NN],ans;
void dfs(int x,int p){
vis[x] = 1;
bool f=0;
for (int to: g[x]){
if (to == p || vis[to] == 2 || ans==0)continue;
if (vis[to] == 1)ans=0;
if (vis[to] == 0 && f==1 && p != -1)ans=0;
if (vis[to] == 0){
dfs(to,x);
f=1;
}
}
}
void Init(int N_){
N=N_;
}
void Link(int A, int B) {
g[A].pb(B);
g[B].pb(A);
}
int CountCritical() {
int res = 0,i,j;
for (i=0;i<N;++i){
vis[i] = 2;
ans=1;
for (j=0;j<N;++j){
if (vis[j] == 0 && ans){
dfs(j,-1);
}
}
for (j=0;j<N;++j)vis[j] = 0;
res+=ans;
}
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
7404 KB |
Output is correct |
2 |
Correct |
166 ms |
7532 KB |
Output is correct |
3 |
Correct |
102 ms |
7660 KB |
Output is correct |
4 |
Correct |
16 ms |
7660 KB |
Output is correct |
5 |
Correct |
179 ms |
7532 KB |
Output is correct |
6 |
Correct |
617 ms |
7916 KB |
Output is correct |
7 |
Correct |
51 ms |
7532 KB |
Output is correct |
8 |
Correct |
103 ms |
7532 KB |
Output is correct |
9 |
Correct |
248 ms |
7660 KB |
Output is correct |
10 |
Correct |
151 ms |
7660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
15 ms |
14976 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
7404 KB |
Output is correct |
2 |
Correct |
166 ms |
7532 KB |
Output is correct |
3 |
Correct |
102 ms |
7660 KB |
Output is correct |
4 |
Correct |
16 ms |
7660 KB |
Output is correct |
5 |
Correct |
179 ms |
7532 KB |
Output is correct |
6 |
Correct |
617 ms |
7916 KB |
Output is correct |
7 |
Correct |
51 ms |
7532 KB |
Output is correct |
8 |
Correct |
103 ms |
7532 KB |
Output is correct |
9 |
Correct |
248 ms |
7660 KB |
Output is correct |
10 |
Correct |
151 ms |
7660 KB |
Output is correct |
11 |
Execution timed out |
4051 ms |
7792 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
7404 KB |
Output is correct |
2 |
Correct |
166 ms |
7532 KB |
Output is correct |
3 |
Correct |
102 ms |
7660 KB |
Output is correct |
4 |
Correct |
16 ms |
7660 KB |
Output is correct |
5 |
Correct |
179 ms |
7532 KB |
Output is correct |
6 |
Correct |
617 ms |
7916 KB |
Output is correct |
7 |
Correct |
51 ms |
7532 KB |
Output is correct |
8 |
Correct |
103 ms |
7532 KB |
Output is correct |
9 |
Correct |
248 ms |
7660 KB |
Output is correct |
10 |
Correct |
151 ms |
7660 KB |
Output is correct |
11 |
Execution timed out |
4051 ms |
7792 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
7404 KB |
Output is correct |
2 |
Correct |
166 ms |
7532 KB |
Output is correct |
3 |
Correct |
102 ms |
7660 KB |
Output is correct |
4 |
Correct |
16 ms |
7660 KB |
Output is correct |
5 |
Correct |
179 ms |
7532 KB |
Output is correct |
6 |
Correct |
617 ms |
7916 KB |
Output is correct |
7 |
Correct |
51 ms |
7532 KB |
Output is correct |
8 |
Correct |
103 ms |
7532 KB |
Output is correct |
9 |
Correct |
248 ms |
7660 KB |
Output is correct |
10 |
Correct |
151 ms |
7660 KB |
Output is correct |
11 |
Runtime error |
15 ms |
14976 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
12 |
Halted |
0 ms |
0 KB |
- |