| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1369065 | altern23 | Stray Cat (JOI20_stray) | C++20 | 27 ms | 13956 KiB |
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
vector <pair<int, int>> adj[20005];
vector <int> X, dist, vtd;
} // namespace
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
for (int i=0; i<M; i++) {
adj[U[i]].push_back({V[i], i}), adj[V[i]].push_back({U[i], i});
}
X.resize(M, -1), dist.resize(N), vtd.resize(N);
queue <int> q;
q.push(0);
vtd[0] = 1;
while (!q.empty()) {
auto idx = q.front(); q.pop();
for (auto [i, j] : adj[idx]) {
if (!vtd[i]) {
dist[i] = (dist[idx]+1)%3;
X[j] = dist[i];
vtd[i] = 1;
q.push(i);
}
else {
X[j] = (dist[i]+1)%3;
}
}
}
return X;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
namespace {
int A, B;
int variable_example = 0;
} // namespace
void Init(int A, int B) {
::A = A;
::B = B;
}
int Move(vector<int> y) {
vector <ll> v;
for (int j = 0; j < A; ++j) {
if (y[j] != 0) {
v.push_back(j);
}
}
sort(v.begin(), v.end(), [&](ll a, ll b) {
return (a+1)%3 == b;
});
return v[0];
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
