#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int>vi;
typedef vector<vi>vvi;
#define pb push_back
namespace {
};
vi Mark(int N, int M, int A, int B,vi U, vi V) {
vi mark(M);
vvi g(N+1);
for(int i=0; i<M;i ++){
g[U[i]].pb(V[i]);
g[V[i]].pb(U[i]);
}
vi D(N+1,-1);
queue<int>q;
q.push(0);
D[0]=0;
while(q.size()){
int x=q.front();
q.pop();
for(int nbr:g[x])
if(D[nbr]==-1)
D[nbr]=D[x]+1,q.push(nbr);
}
for(int i=0; i<M; i++)
if(min(D[U[i]],D[V[i]])%2==0)
mark[i]=1;
return mark;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int>vi;
typedef vector<vi>vvi;
#define all(x) x.begin(),x.end()
//I can retrieve information between moves
namespace {
int A, B;
bool reached_leaf=0;
};
void Init(int _A, int _B) {
A=_A,B=_B;
}
int Move(vi y) {
for(int i=0; i<y.size(); i++)
if(y[i]==1)
return i;
return -1;
}
Compilation message
Catherine.cpp: In function 'int Move(vi)':
Catherine.cpp:24:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
24 | for(int i=0; i<y.size(); i++)
| ~^~~~~~~~~
Catherine.cpp: At global scope:
Catherine.cpp:13:10: warning: '{anonymous}::reached_leaf' defined but not used [-Wunused-variable]
13 | bool reached_leaf=0;
| ^~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
31 ms |
14840 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
31 ms |
14840 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
36 ms |
12576 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
36 ms |
12576 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
768 KB |
Output is correct |
2 |
Correct |
0 ms |
524 KB |
Output is correct |
3 |
Correct |
2 ms |
900 KB |
Output is correct |
4 |
Correct |
2 ms |
972 KB |
Output is correct |
5 |
Correct |
2 ms |
908 KB |
Output is correct |
6 |
Correct |
2 ms |
952 KB |
Output is correct |
7 |
Correct |
2 ms |
900 KB |
Output is correct |
8 |
Correct |
2 ms |
908 KB |
Output is correct |
9 |
Correct |
2 ms |
868 KB |
Output is correct |
10 |
Correct |
2 ms |
900 KB |
Output is correct |
11 |
Correct |
2 ms |
996 KB |
Output is correct |
12 |
Incorrect |
2 ms |
900 KB |
Wrong Answer [6] |
13 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
28 ms |
10844 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
32 ms |
10736 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |