| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1369082 | altern23 | Stray Cat (JOI20_stray) | C++20 | 23 ms | 12488 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)%A;
X[j] = dist[i];
vtd[i] = 1;
q.push(i);
}
// cout << j << " " << X[j] << "\n";
}
}
return X;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
namespace {
int A, B;
int lst = -1;
} // namespace
void Init(int A, int B) {
::A = A;
::B = B;
}
int Move(vector<int> y) {
if (lst == -1) {
if (y[0]<y[1] && y[0]) {
lst = 0;
return 0;
}
lst = 1;
return 1;
}
if (!y[lst^1]) return -1;
lst ^= 1;
return lst;
}
| # | 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... | ||||
