# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
829679 |
2023-08-18T14:03:43 Z |
Blagoj |
Stray Cat (JOI20_stray) |
C++17 |
|
39 ms |
16480 KB |
#include <bits/stdc++.h>
#include "Anthony.h"
namespace {
int FunctionExample(int i, int A) { return i % A; }
} // namespace
using namespace std;
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
vector<int> X(M);
queue<pair<int, int>> q;
q.push({0, 0});
string s = "001011";
vector<pair<int, int>> g[N];
for (int i = 0; i < M; i++) {
g[U[i]].push_back({V[i], i});
g[V[i]].push_back({U[i], i});
}
bool visited[N + 2];
memset(visited, 0, sizeof(visited));
visited[0] = 1;
while (q.size()) {
int cur = q.front().first, clr = q.front().second;
q.pop();
for (auto [to, id] : g[cur]) {
if (visited[to]) continue;
visited[to] = 1;
q.push({to, (clr + 1) % 3});
// cout << id << " : " << clr << endl;
X[id] = clr;
}
}
// for (int i = 0; i < X.size(); i++) cout << U[i] << " " << V[i] << " : " << X[i] << endl;
return X;
}
#include <bits/stdc++.h>
#include "Catherine.h"
namespace {
int A, B;
} // namespace
using namespace std;
void Init(int A, int B) {
::A = A;
::B = B;
}
int Move(vector<int> y) {
set<int> options;
bool gr[4];
memset(gr, 0, sizeof(gr));
for (int i = 0; i < y.size(); i++) {
gr[i] = min(1, y[i]);
// cout << i << " : " << y[i] << endl;
if (y[i]) options.insert(i);
}
if (options.size() == 1) {
// cout << "! " << *options.begin() << endl;
return *options.begin();
}
if (gr[0] && gr[2]) {
// cout << "? \n";
return 2;
}
if (gr[1] && gr[2]) {
// cout << ".\n";
return 1;
}
return 0;
}
Compilation message
Anthony.cpp:6:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
6 | int FunctionExample(int i, int A) { return i % A; }
| ^~~~~~~~~~~~~~~
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:21:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
21 | for (int i = 0; i < y.size(); i++) {
| ~~^~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
15456 KB |
Output is correct |
2 |
Correct |
1 ms |
516 KB |
Output is correct |
3 |
Correct |
26 ms |
14672 KB |
Output is correct |
4 |
Correct |
34 ms |
16480 KB |
Output is correct |
5 |
Correct |
35 ms |
16400 KB |
Output is correct |
6 |
Correct |
26 ms |
15268 KB |
Output is correct |
7 |
Correct |
26 ms |
15208 KB |
Output is correct |
8 |
Correct |
32 ms |
15820 KB |
Output is correct |
9 |
Correct |
39 ms |
15700 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
15456 KB |
Output is correct |
2 |
Correct |
1 ms |
516 KB |
Output is correct |
3 |
Correct |
26 ms |
14672 KB |
Output is correct |
4 |
Correct |
34 ms |
16480 KB |
Output is correct |
5 |
Correct |
35 ms |
16400 KB |
Output is correct |
6 |
Correct |
26 ms |
15268 KB |
Output is correct |
7 |
Correct |
26 ms |
15208 KB |
Output is correct |
8 |
Correct |
32 ms |
15820 KB |
Output is correct |
9 |
Correct |
39 ms |
15700 KB |
Output is correct |
10 |
Incorrect |
23 ms |
13224 KB |
Wrong Answer [6] |
11 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
12912 KB |
Output is correct |
2 |
Correct |
0 ms |
508 KB |
Output is correct |
3 |
Correct |
22 ms |
12396 KB |
Output is correct |
4 |
Correct |
34 ms |
14164 KB |
Output is correct |
5 |
Correct |
36 ms |
14192 KB |
Output is correct |
6 |
Correct |
29 ms |
13024 KB |
Output is correct |
7 |
Correct |
32 ms |
12992 KB |
Output is correct |
8 |
Correct |
28 ms |
13524 KB |
Output is correct |
9 |
Correct |
30 ms |
13592 KB |
Output is correct |
10 |
Correct |
28 ms |
13280 KB |
Output is correct |
11 |
Correct |
30 ms |
13236 KB |
Output is correct |
12 |
Correct |
34 ms |
13256 KB |
Output is correct |
13 |
Correct |
27 ms |
13284 KB |
Output is correct |
14 |
Correct |
30 ms |
13580 KB |
Output is correct |
15 |
Correct |
30 ms |
13700 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
12912 KB |
Output is correct |
2 |
Correct |
0 ms |
508 KB |
Output is correct |
3 |
Correct |
22 ms |
12396 KB |
Output is correct |
4 |
Correct |
34 ms |
14164 KB |
Output is correct |
5 |
Correct |
36 ms |
14192 KB |
Output is correct |
6 |
Correct |
29 ms |
13024 KB |
Output is correct |
7 |
Correct |
32 ms |
12992 KB |
Output is correct |
8 |
Correct |
28 ms |
13524 KB |
Output is correct |
9 |
Correct |
30 ms |
13592 KB |
Output is correct |
10 |
Correct |
28 ms |
13280 KB |
Output is correct |
11 |
Correct |
30 ms |
13236 KB |
Output is correct |
12 |
Correct |
34 ms |
13256 KB |
Output is correct |
13 |
Correct |
27 ms |
13284 KB |
Output is correct |
14 |
Correct |
30 ms |
13580 KB |
Output is correct |
15 |
Correct |
30 ms |
13700 KB |
Output is correct |
16 |
Incorrect |
22 ms |
11488 KB |
Wrong Answer [6] |
17 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
644 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
2172 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
2176 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |