# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
829618 |
2023-08-18T13:23:47 Z |
MODDI |
Stray Cat (JOI20_stray) |
C++14 |
|
43 ms |
16616 KB |
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
namespace {
} // namespace
std::vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
vi arr(M, -1);
vector<vector<pii>> G(N, vector<pii>());
for(int i = 0; i < M; i++){
int u = U[i], v = V[i];
G[u].pb({v, i});
G[v].pb({u, i});
}
vi dist(N, N);
dist[0] = 0;
queue<int> q;
q.push(0);
while(!q.empty()){
int v = q.front();
q.pop();
for(pii next : G[v]){
if(dist[next.first] == N){
dist[next.first] = 1 + dist[v];
q.push(next.first);
}
}
}
if(A >= 3){
for(int i = 0; i < M; i++){
arr[i] = min(dist[U[i]], dist[V[i]]) % 3;
}
return arr;
}
return arr;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
namespace {
int A;
bool bambooPart;
vector<int> colors;
bool GoingUp(vector<int> s) {
vector<int> t = {1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0};
// reverse(t.begin(), t.end());
for (int i = 0; i + (int)s.size() <= (int)t.size(); i++) {
bool ok = true;
for (int j = 0; j < (int)s.size(); j++)
ok &= s[j] == t[i + j];
if (ok) return true;
}
return false;
}
} // namespace
void Init(int A, int B) {
::A = A;
::bambooPart = true;
::colors = vector<int>();
}
int Move(std::vector<int> y) {
if (::A > 2) {
int c = 0;
while(c < 3) {
if (y[c] > 0 && y[(c + 2) % 3] == 0) break;
c++;
}
assert(c < 3);
return c;
}
}
Compilation message
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
48 | }
| ^
Catherine.cpp: At global scope:
Catherine.cpp:17:6: warning: 'bool {anonymous}::GoingUp(std::vector<int>)' defined but not used [-Wunused-function]
17 | bool GoingUp(vector<int> s) {
| ^~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
15024 KB |
Output is correct |
2 |
Correct |
2 ms |
520 KB |
Output is correct |
3 |
Correct |
35 ms |
14816 KB |
Output is correct |
4 |
Correct |
32 ms |
16448 KB |
Output is correct |
5 |
Correct |
36 ms |
16616 KB |
Output is correct |
6 |
Correct |
30 ms |
15272 KB |
Output is correct |
7 |
Correct |
27 ms |
15248 KB |
Output is correct |
8 |
Correct |
32 ms |
15984 KB |
Output is correct |
9 |
Correct |
43 ms |
16004 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
15024 KB |
Output is correct |
2 |
Correct |
2 ms |
520 KB |
Output is correct |
3 |
Correct |
35 ms |
14816 KB |
Output is correct |
4 |
Correct |
32 ms |
16448 KB |
Output is correct |
5 |
Correct |
36 ms |
16616 KB |
Output is correct |
6 |
Correct |
30 ms |
15272 KB |
Output is correct |
7 |
Correct |
27 ms |
15248 KB |
Output is correct |
8 |
Correct |
32 ms |
15984 KB |
Output is correct |
9 |
Correct |
43 ms |
16004 KB |
Output is correct |
10 |
Correct |
27 ms |
13336 KB |
Output is correct |
11 |
Correct |
25 ms |
13328 KB |
Output is correct |
12 |
Correct |
25 ms |
13340 KB |
Output is correct |
13 |
Correct |
32 ms |
13368 KB |
Output is correct |
14 |
Correct |
31 ms |
13636 KB |
Output is correct |
15 |
Correct |
38 ms |
13948 KB |
Output is correct |
16 |
Correct |
36 ms |
16056 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
12692 KB |
Output is correct |
2 |
Correct |
0 ms |
520 KB |
Output is correct |
3 |
Correct |
20 ms |
12660 KB |
Output is correct |
4 |
Correct |
32 ms |
14360 KB |
Output is correct |
5 |
Correct |
32 ms |
14376 KB |
Output is correct |
6 |
Correct |
25 ms |
13108 KB |
Output is correct |
7 |
Correct |
35 ms |
13164 KB |
Output is correct |
8 |
Correct |
34 ms |
13824 KB |
Output is correct |
9 |
Correct |
32 ms |
13668 KB |
Output is correct |
10 |
Correct |
27 ms |
13500 KB |
Output is correct |
11 |
Correct |
32 ms |
13528 KB |
Output is correct |
12 |
Correct |
27 ms |
13504 KB |
Output is correct |
13 |
Correct |
28 ms |
13480 KB |
Output is correct |
14 |
Correct |
30 ms |
13852 KB |
Output is correct |
15 |
Correct |
30 ms |
13756 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
12692 KB |
Output is correct |
2 |
Correct |
0 ms |
520 KB |
Output is correct |
3 |
Correct |
20 ms |
12660 KB |
Output is correct |
4 |
Correct |
32 ms |
14360 KB |
Output is correct |
5 |
Correct |
32 ms |
14376 KB |
Output is correct |
6 |
Correct |
25 ms |
13108 KB |
Output is correct |
7 |
Correct |
35 ms |
13164 KB |
Output is correct |
8 |
Correct |
34 ms |
13824 KB |
Output is correct |
9 |
Correct |
32 ms |
13668 KB |
Output is correct |
10 |
Correct |
27 ms |
13500 KB |
Output is correct |
11 |
Correct |
32 ms |
13528 KB |
Output is correct |
12 |
Correct |
27 ms |
13504 KB |
Output is correct |
13 |
Correct |
28 ms |
13480 KB |
Output is correct |
14 |
Correct |
30 ms |
13852 KB |
Output is correct |
15 |
Correct |
30 ms |
13756 KB |
Output is correct |
16 |
Correct |
23 ms |
11568 KB |
Output is correct |
17 |
Correct |
26 ms |
11536 KB |
Output is correct |
18 |
Correct |
24 ms |
11464 KB |
Output is correct |
19 |
Correct |
24 ms |
11420 KB |
Output is correct |
20 |
Correct |
26 ms |
11976 KB |
Output is correct |
21 |
Correct |
26 ms |
11868 KB |
Output is correct |
22 |
Correct |
28 ms |
13808 KB |
Output is correct |
23 |
Correct |
28 ms |
11500 KB |
Output is correct |
24 |
Correct |
31 ms |
11568 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
636 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
2328 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
2284 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |