# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
974063 | Ooops_sorry | Stray Cat (JOI20_stray) | C++14 | 40 ms | 28420 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#ifndef LOCAL
#include "Anthony.h"
#endif
#include<iostream>
#include<deque>
#include<algorithm>
#include<vector>
#include<map>
#include<random>
#include<time.h>
#include<cassert>
#include<chrono>
#include<set>
#include<unordered_set>
#include<array>
using namespace std;
#define ull unsigned long long
#define pb push_back
#define ll long long
#define all(a) a.begin(), a.end()
#define ld long double
mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const int N = 2e4 + 10;
vector<pair<int, int>> g[N];
vector<int> Mark(int n, int m, int a, int b, vector<int> u, vector<int> v) {
for (int i = 0; i < m; i++) {
g[u[i]].pb({v[i], i});
g[v[i]].pb({u[i], i});
}
if (a == 3) {
vector<int> d(n, -1);
d[0] = 0;
deque<int> q{0};
while (q.size() > 0) {
int v = q.front();
q.pop_front();
for (auto [u, i] : g[v]) {
if (d[u] == -1) {
d[u] = d[v] + 1;
q.pb(u);
}
}
}
vector<int> ans(m, -1);
for (int v = 0; v < n; v++) {
for (auto [u, i] : g[v]) {
if (d[u] == d[v]) {
ans[i] = d[u] % 3;
} else {
ans[i] = min(d[u], d[v]) % 3;
}
}
}
return ans;
}
}
#ifndef LOCAL
#include "Catherine.h"
#endif
#include<iostream>
#include<deque>
#include<algorithm>
#include<vector>
#include<map>
#include<random>
#include<time.h>
#include<cassert>
#include<chrono>
#include<set>
#include<unordered_set>
#include<array>
using namespace std;
#define ull unsigned long long
#define pb push_back
#define ll long long
#define all(a) a.begin(), a.end()
#define ld long double
mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
int A, B;
void Init(int A_, int B_) {
A = A_;
B = B_;
}
int Move(std::vector<int> y) {
if (A == 3) {
for (int i = 0; i < 3; i++) {
if (y[i] > 0 && y[(i + 1) % 3] > 0) {
return i;
}
}
for (int i = 0; i < 3; i++) {
if (y[i] > 0) {
return i;
}
}
}
assert(0);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |