# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
994545 |
2024-06-07T19:09:26 Z |
TimDee |
Stray Cat (JOI20_stray) |
C++17 |
|
37 ms |
17208 KB |
#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;
return ans;
}
#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;
if (a[1]&&a[2]) return 1;
forn(i,3) if (a[i]) return i;
}
Compilation message
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type]
19 | }
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
15732 KB |
Output is correct |
2 |
Correct |
1 ms |
1312 KB |
Output is correct |
3 |
Correct |
24 ms |
15676 KB |
Output is correct |
4 |
Correct |
37 ms |
17084 KB |
Output is correct |
5 |
Correct |
31 ms |
17208 KB |
Output is correct |
6 |
Correct |
31 ms |
15912 KB |
Output is correct |
7 |
Correct |
26 ms |
16028 KB |
Output is correct |
8 |
Correct |
32 ms |
16716 KB |
Output is correct |
9 |
Correct |
29 ms |
16716 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
15732 KB |
Output is correct |
2 |
Correct |
1 ms |
1312 KB |
Output is correct |
3 |
Correct |
24 ms |
15676 KB |
Output is correct |
4 |
Correct |
37 ms |
17084 KB |
Output is correct |
5 |
Correct |
31 ms |
17208 KB |
Output is correct |
6 |
Correct |
31 ms |
15912 KB |
Output is correct |
7 |
Correct |
26 ms |
16028 KB |
Output is correct |
8 |
Correct |
32 ms |
16716 KB |
Output is correct |
9 |
Correct |
29 ms |
16716 KB |
Output is correct |
10 |
Correct |
27 ms |
14220 KB |
Output is correct |
11 |
Correct |
25 ms |
14148 KB |
Output is correct |
12 |
Correct |
26 ms |
14104 KB |
Output is correct |
13 |
Correct |
23 ms |
13944 KB |
Output is correct |
14 |
Correct |
26 ms |
14308 KB |
Output is correct |
15 |
Correct |
28 ms |
14656 KB |
Output is correct |
16 |
Correct |
32 ms |
16752 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
13252 KB |
Output is correct |
2 |
Correct |
1 ms |
1308 KB |
Output is correct |
3 |
Correct |
20 ms |
13388 KB |
Output is correct |
4 |
Correct |
33 ms |
15256 KB |
Output is correct |
5 |
Correct |
31 ms |
15044 KB |
Output is correct |
6 |
Correct |
26 ms |
13640 KB |
Output is correct |
7 |
Correct |
24 ms |
13640 KB |
Output is correct |
8 |
Correct |
34 ms |
14416 KB |
Output is correct |
9 |
Correct |
28 ms |
14340 KB |
Output is correct |
10 |
Correct |
27 ms |
14164 KB |
Output is correct |
11 |
Correct |
26 ms |
14144 KB |
Output is correct |
12 |
Correct |
26 ms |
14068 KB |
Output is correct |
13 |
Correct |
26 ms |
14156 KB |
Output is correct |
14 |
Correct |
34 ms |
14416 KB |
Output is correct |
15 |
Correct |
34 ms |
14712 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
13252 KB |
Output is correct |
2 |
Correct |
1 ms |
1308 KB |
Output is correct |
3 |
Correct |
20 ms |
13388 KB |
Output is correct |
4 |
Correct |
33 ms |
15256 KB |
Output is correct |
5 |
Correct |
31 ms |
15044 KB |
Output is correct |
6 |
Correct |
26 ms |
13640 KB |
Output is correct |
7 |
Correct |
24 ms |
13640 KB |
Output is correct |
8 |
Correct |
34 ms |
14416 KB |
Output is correct |
9 |
Correct |
28 ms |
14340 KB |
Output is correct |
10 |
Correct |
27 ms |
14164 KB |
Output is correct |
11 |
Correct |
26 ms |
14144 KB |
Output is correct |
12 |
Correct |
26 ms |
14068 KB |
Output is correct |
13 |
Correct |
26 ms |
14156 KB |
Output is correct |
14 |
Correct |
34 ms |
14416 KB |
Output is correct |
15 |
Correct |
34 ms |
14712 KB |
Output is correct |
16 |
Correct |
23 ms |
12108 KB |
Output is correct |
17 |
Correct |
22 ms |
12108 KB |
Output is correct |
18 |
Correct |
24 ms |
12096 KB |
Output is correct |
19 |
Correct |
26 ms |
12084 KB |
Output is correct |
20 |
Correct |
28 ms |
12880 KB |
Output is correct |
21 |
Correct |
27 ms |
12556 KB |
Output is correct |
22 |
Correct |
27 ms |
14720 KB |
Output is correct |
23 |
Correct |
24 ms |
12244 KB |
Output is correct |
24 |
Correct |
23 ms |
12364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1304 KB |
Program didn't exit properly, or you printed something to stdout. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
1548 KB |
Program didn't exit properly, or you printed something to stdout. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
1560 KB |
Program didn't exit properly, or you printed something to stdout. |
2 |
Halted |
0 ms |
0 KB |
- |