#include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> V;
map<long long,long long> sumas;
void Init(int N){
vector<long long> V1(N,0);
for(int i=0;i<N;i++){
V.push_back(V1);
}
}
void Link(int A,int B){
V[A][B]=1;
V[B][A]=1;
sumas[A]++;
sumas[B]++;
}
int CountCritical(){
int critical=0;
long long jaja=V.size();
for(int i=0;i<jaja;i++){
bool es=true;
for(int j=0;j<jaja;j++){
if(i!=j){
if(V[j][i]==1){
if(sumas[j]-1>2){
es=false;
break;
}
}else{
if(sumas[j]>2){
es=false;
break;
}
}
}
}
if(es){
critical++;
}
}
return critical;
}
/*int main(){
Init(5);
Link(0,2);
Link(0,3);
int res=CountCritical();
cout<<res;
}*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
683 ms |
137640 KB |
Output is correct |
3 |
Correct |
190 ms |
196512 KB |
Output is correct |
4 |
Incorrect |
22 ms |
8272 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
122 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
683 ms |
137640 KB |
Output is correct |
3 |
Correct |
190 ms |
196512 KB |
Output is correct |
4 |
Incorrect |
22 ms |
8272 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
683 ms |
137640 KB |
Output is correct |
3 |
Correct |
190 ms |
196512 KB |
Output is correct |
4 |
Incorrect |
22 ms |
8272 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
683 ms |
137640 KB |
Output is correct |
3 |
Correct |
190 ms |
196512 KB |
Output is correct |
4 |
Incorrect |
22 ms |
8272 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |