# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
939306 |
2024-03-06T08:51:27 Z |
Pring |
Stray Cat (JOI20_stray) |
C++14 |
|
0 ms |
0 KB |
#include <bits/stdc++.h>
#include "Anthony.h"
using namespace std;
const string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m";
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
typedef pair<int, int> pii;
namespace {
const int MXN = 20005;
int n, m, A, B;
vector<int> eu, ev;
vector<int> eid[MXN];
int d[MXN];
vector<int> tag;
namespace NSA {
void BSH(int sr) {
fill(d, d + n, -1);
queue<pii> q;
q.push(mp(0, sr));
while (q.size()) {
auto [dep, id] = q.front();
q.pop();
if (d[id] != -1) continue;
d[id] = dep;
for (auto &e : eid[id]) {
int i = eu[e] ^ ev[e] ^ id;
if (d[i] != -1) continue;
q.push(mp(dep + 1, i));
}
}
}
vector<int> Mark() {
BSH(0);
tag.resize(m);
FOR(i, 0, m) {
if (d[eu[i]] == d[ev[i]]) tag[i] = d[eu[i]] % 3;
else tag[i] = min(d[eu[i]], d[ev[i]]) % 3;
}
return tag;
}
}
namespace NSB {
vector<int> Mark() {
return vector<int>();
}
}
}
vector<int> Mark(int _n, int _m, int _a, int _b, vector<int> _eu, vector<int> _ev) {
n = _n;
m = _m;
A = _a;
B = _b;
eu = _eu;
ev = _ev;
FOR(i, 0, m) {
eid[eu[i]].push_back(i);
eid[ev[i]].push_back(i);
}
return (A >= 3 ? NSA::Mark() : NSB::Mark());
}
#include <bits/stdc++.h>
#include "Anthony.h"
using namespace std;
const string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m";
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
typedef pair<int, int> pii;
namespace {
const int MXN = 20005;
int n, m, A, B;
vector<int> eu, ev;
vector<int> eid[MXN];
int d[MXN];
vector<int> tag;
namespace NSA {
void BSH(int sr) {
fill(d, d + n, -1);
queue<pii> q;
q.push(mp(0, sr));
while (q.size()) {
auto [dep, id] = q.front();
q.pop();
if (d[id] != -1) continue;
d[id] = dep;
for (auto &e : eid[id]) {
int i = eu[e] ^ ev[e] ^ id;
if (d[i] != -1) continue;
q.push(mp(dep + 1, i));
}
}
}
vector<int> Mark() {
BSH(0);
tag.resize(m);
FOR(i, 0, m) {
if (d[eu[i]] == d[ev[i]]) tag[i] = d[eu[i]] % 3;
else tag[i] = min(d[eu[i]], d[ev[i]]) % 3;
}
return tag;
}
}
namespace NSB {
vector<int> Mark() {
return vector<int>();
}
}
}
vector<int> Mark(int _n, int _m, int _a, int _b, vector<int> _eu, vector<int> _ev) {
n = _n;
m = _m;
A = _a;
B = _b;
eu = _eu;
ev = _ev;
FOR(i, 0, m) {
eid[eu[i]].push_back(i);
eid[ev[i]].push_back(i);
}
return (A >= 3 ? NSA::Mark() : NSB::Mark());
}
Compilation message
Anthony.cpp: In function 'void {anonymous}::NSA::BSH(int)':
Anthony.cpp:27:22: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
27 | auto [dep, id] = q.front();
| ^
Catherine.cpp: In function 'void {anonymous}::NSA::BSH(int)':
Catherine.cpp:27:22: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
27 | auto [dep, id] = q.front();
| ^
/usr/bin/ld: /tmp/ccNI6FRk.o: in function `main':
grader_catherine.cpp:(.text.startup+0x41c): undefined reference to `Init(int, int)'
/usr/bin/ld: grader_catherine.cpp:(.text.startup+0xcfa): undefined reference to `Move(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status