#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0; i<(n); ++i)
#define pb push_back
#define pi pair<int,int>
#define f first
#define s second
const int N=2e4+5;
vector<pi> adj[N];
int z[N];
vector<int> Mark(int n, int m, int A, int B, vector<int> u, vector<int> v) {
if (A<3) exit(0);
forn(i,m) {
adj[u[i]].pb({v[i],i});
adj[v[i]].pb({u[i],i});
}
queue<int> q; q.push(0);
vector<int> vis(n); vis[0]=1;
vector<int> d(n);
while (q.size()) {
int u=q.front(); q.pop();
for(auto&e:adj[u]) {
int v=e.f, i=e.s;
if (!z[i]) {
z[i] = (d[u]%3)+1;
}
if (vis[v]) continue;
vis[v]=1;
q.push(v);
d[v]=d[u]+1;
}
}
vector<int> ans(m);
forn(i,m) ans[i]=z[i]-1;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0; i<(n); ++i)
#define pb push_back
#define pi pair<int,int>
#define f first
#define s second
void Init(int A, int B) {
if (A<3) exit(0);
}
int Move(vector<int> a) {
if (a[0]&&a[2]) return 2;
if (a[0]&&a[1]) return 0;
return 1;
}
Compilation message
Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:21:16: warning: control reaches end of non-void function [-Wreturn-type]
21 | queue<int> q; q.push(0);
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
7 ms |
4444 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
7 ms |
4444 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
7 ms |
4444 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
7 ms |
4444 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1348 KB |
Program didn't exit properly, or you printed something to stdout. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
2032 KB |
Program didn't exit properly, or you printed something to stdout. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
2012 KB |
Program didn't exit properly, or you printed something to stdout. |
2 |
Halted |
0 ms |
0 KB |
- |