#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair<int,int>
#define fi first
#define se second
#define puf push_front
#define pof pop_front
#define pub push_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound
#define rep(x,s,e) for (int x=(s)-((s)>(e));x!=(e)-((s)>(e));((s)<(e))?x++:x--)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()
namespace {
bool st;
int n,m;
vector<int> al[20005];
int w[20005];
queue<int> q;
}
vector<signed> Mark(signed N, signed M, signed A, signed B,
vector<signed> U, vector<signed> V) {
st=(A>=3);
n=N,m=M;
if (st){
rep(x,0,m){
al[U[x]].pub(V[x]);
al[V[x]].pub(U[x]);
}
memset(w,-1,sizeof(w));
q.push(0);
while (!q.empty()){
int u=q.front(); q.pop();
for (auto it:al[u]) if (w[it]==-1){
w[it]=w[u]+1;
q.push(it);
}
}
vector<signed> res;
rep(x,0,m){
int a=w[U[x]],b=w[V[x]];
res.pub(min(w[U[x]],w[V[x]])%3);
}
return res;
}
else{
return {};
}
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair<int,int>
#define fi first
#define se second
#define puf push_front
#define pof pop_front
#define pub push_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound
#define rep(x,s,e) for (int x=(s)-((s)>(e));x!=(e)-((s)>(e));((s)<(e))?x++:x--)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()
namespace {
bool st;
int PREV=-1;
}
void Init(signed A, signed B) {
st=(A>=3);
}
signed Move(vector<signed> y) {
if (st){
vector<int> v;
rep(x,0,3) if (y[x] || PREV==x) v.pub(x);
sort(all(v));
if (sz(v)==1){
return PREV=v[0];
}
else if (v[1]==1){
return PREV=0;
}
else if (v[0]==1){
return PREV=1;
}
else{
return PREV=2;
}
}
else{
return 69;
}
}
Compilation message
Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:56:8: warning: unused variable 'a' [-Wunused-variable]
56 | int a=w[U[x]],b=w[V[x]];
| ^
Anthony.cpp:56:18: warning: unused variable 'b' [-Wunused-variable]
56 | int a=w[U[x]],b=w[V[x]];
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
47 ms |
15984 KB |
Output is correct |
2 |
Correct |
1 ms |
1220 KB |
Output is correct |
3 |
Incorrect |
32 ms |
15388 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
47 ms |
15984 KB |
Output is correct |
2 |
Correct |
1 ms |
1220 KB |
Output is correct |
3 |
Incorrect |
32 ms |
15388 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
36 ms |
13628 KB |
Output is correct |
2 |
Correct |
1 ms |
1156 KB |
Output is correct |
3 |
Incorrect |
30 ms |
13160 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
36 ms |
13628 KB |
Output is correct |
2 |
Correct |
1 ms |
1156 KB |
Output is correct |
3 |
Incorrect |
30 ms |
13160 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
1028 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
1756 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
1612 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |