#include "Anthony.h"
#include <bits//stdc++.h>
using namespace std;
#define ll long long
#define iloop(m, h) for (auto i = m; i != h; i+=(m<h?1:-1))
#define jloop(m, h) for (auto j = m; j != h; j+=(m<h?1:-1))
#define kloop(m, h) for (auto k = m; k != h; k+=(m<h?1:-1))
#define lloop(m, h) for (auto l = m; l != h; l+=(m<h?1:-1))
#define iloop_(m, h, g) for (auto i = m; i != h; i+=g)
#define jloop_(m, h, g) for (auto j = m; j != h; j+=g)
#define kloop_(m, h, g) for (auto k = m; k != h; k+=g)
#define lloop_(m, h, g) for (auto l = m; l != h; l+=g)
#define getchar_unlocked _getchar_nolock // comment before submission
#define pll pair<ll,ll>
#define plll pair<ll, pll>
#define pllll pair<pll, pll>
#define vll vector<ll>
#define qll queue<ll>
#define dll deque<ll>
#define pqll priority_queue<ll>
#define gll greater<ll>
#define INF 1000000000000000
#define MOD1 1000000007
#define MOD2 998244353
#define MOD3 1000000009
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
vector<int> X(M);
vector<int> adj[N];
iloop(0, M) {
adj[U[i]].push_back(V[i]);
adj[V[i]].push_back(U[i]);
}
queue<int> q, nq;
q.push(0);
int dist = 1;
bool vis[N] = {};
int dis[N];
dis[0] = 0;
while (q.size()) {
while (q.size()) {
int nd = q.front();
q.pop();
for (auto it : adj[nd]) {
if (!vis[it]) {
vis[it] = 1;
nq.push(it);
}
}
}
while (nq.size()) {
dis[nq.front()] = dist;
q.push(nq.front());
nq.pop();
}
dist++;
}
iloop(0, M) {
X[i] = min(dis[U[i]], dis[V[i]])%3;
//cout << X[i] << " ";
}
//cout << "\n";
return X;
}
#include "Catherine.h"
#include <bits//stdc++.h>
using namespace std;
#define ll long long
#define iloop(m, h) for (auto i = m; i != h; i+=(m<h?1:-1))
#define jloop(m, h) for (auto j = m; j != h; j+=(m<h?1:-1))
#define kloop(m, h) for (auto k = m; k != h; k+=(m<h?1:-1))
#define lloop(m, h) for (auto l = m; l != h; l+=(m<h?1:-1))
#define iloop_(m, h, g) for (auto i = m; i != h; i+=g)
#define jloop_(m, h, g) for (auto j = m; j != h; j+=g)
#define kloop_(m, h, g) for (auto k = m; k != h; k+=g)
#define lloop_(m, h, g) for (auto l = m; l != h; l+=g)
#define getchar_unlocked _getchar_nolock // comment before submission
#define pll pair<ll,ll>
#define plll pair<ll, pll>
#define pllll pair<pll, pll>
#define vll vector<ll>
#define qll queue<ll>
#define dll deque<ll>
#define pqll priority_queue<ll>
#define gll greater<ll>
#define INF 1000000000000000
#define MOD1 1000000007
#define MOD2 998244353
#define MOD3 1000000009
int oa, ob;
void Init(int A, int B) {
oa = A, ob = B;
}
int Move(vector<int> y) {
//iloop(0, 3) cout << y[i] << " ";
//cout << "\n";
if (y[0] == 0) {
if (y[1] == 0) return 2;
return 1;
}
if (y[1] == 0) {
if (y[2] == 0) return 0;
return 2;
}
if (y[2] == 0) {
if (y[0] == 0) return 1;
return 0;
}
abort();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
52 ms |
15384 KB |
Output is correct |
2 |
Correct |
2 ms |
508 KB |
Output is correct |
3 |
Incorrect |
30 ms |
14708 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
52 ms |
15384 KB |
Output is correct |
2 |
Correct |
2 ms |
508 KB |
Output is correct |
3 |
Incorrect |
30 ms |
14708 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
12804 KB |
Output is correct |
2 |
Correct |
0 ms |
508 KB |
Output is correct |
3 |
Incorrect |
27 ms |
12384 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
12804 KB |
Output is correct |
2 |
Correct |
0 ms |
508 KB |
Output is correct |
3 |
Incorrect |
27 ms |
12384 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
644 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
2176 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
15 ms |
2256 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |