Submission #69080048
Source Code Expand
#include <bits/extc++.h>
#include <numeric>
using namespace std;
using namespace __gnu_pbds;
// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
template<typename T>
class vt : public vector<T> {
public:
using vector<T>::vector;
using vector<T>::push_back;
template<class U, class = decltype(begin(declval<U>()))>
typename enable_if<!is_same<U, string>::value>::type push_back(const U v) { for (auto i : v) this->push_back(i); }
template<typename... Args>
void push_back(Args&&... args) {
(this->vector<T>::push_back(std::forward<Args>(args)), ...);
}
template<class arg>
vt<T> &operator+=(arg&& val) { this->push_back(val); return *this; }
vt<T> &sort(int reverse = 0) {
if (!reverse) std::sort(vector<T>::begin(), vector<T>::end());
else std::sort(vector<T>::rbegin(), vector<T>::rend());
return *this;
}
int find(T x) { // returns -1 if not found
for (int i = 0; i < vector<T>::size(); i++) if ((*this)[i] == x) return i;
return -1;
}
bool has(T x) { return find(x) != -1; }
};
template <class T>
using vvt = vt<vt<T>>;
template <class T>
using vvvt = vt<vvt<T>>;
template <class T>
using vvvvt = vector<vvvt<T>>;
template <class T>
using vvvvvt = vector<vvvvt<T>>;
#define vv(type, name, h, ...) \
vvt<type> name(h, vt<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) \
vvvt<type> name( \
h, vvt<type>(w, vt<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...) \
vvvvt<type> name( \
a, vvvt<type>( \
b, vvt<type>(c, vt<type>(__VA_ARGS__))))
using str = string;
using ll = long long;
using ull = unsigned long long;
using lll = __int128_t;
using ulll = __uint128_t;
using db = double;
using ldb = long double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using vi = vt<int>;
using vl = vt<ll>;
using vb = vt<bool>;
using vdb = vt<db>;
using vvi = vt<vt<int>>;
using vvl = vt<vt<ll>>;
using vvb = vt<vt<bool>>;
using vpi = vt<pi>;
using vpl = vt<pl>;
const ll mod = 1e9 + 7;
// const ll mod = 998244353;
const int precision = 24;
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash { // large odd number for C
const uint64_t C = ll(4e18 * acos(0)) | 71;
ll operator()(ll x) const { return __builtin_bswap64((x ^ RANDOM) * C); }
};
#define gptable gp_hash_table
#define priority_queue std::priority_queue
template<class K, class V, class hash> gptable<K, V, hash> make_gptable() {
return gptable<K, V, hash>({}, {}, {}, {}, {1 << 16});
}
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define bg(x) begin(x)
#define en(x) end(x)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define size(x) (static_cast<int>((x).size()))
#define sq(x) ((x) * (x))
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#ifndef LOCAL
#define endl '\n'
#endif
#define lb lower_bound
#define ub upper_bound
template<class T> int lwb(vt<T>& a, const T& b) { return int(lb(all(a), b) - bg(a)); }
template<class T> int upb(vt<T>& a, const T& b) { return int(ub(all(a), b) - bg(a)); }
template<class T> void rem_dup(vt<T>& v) { sort(all(v)); v.erase(unique(all(v)), v.end()); }
#define contains(a, x) find(all(x), a) == end(x)
#define cmp(exp) [&] (const auto& x, const auto& y) { return exp; }
#define __NARG__(...) __NARG_I_(__VA_ARGS__,__RSEQ_N())
#define __NARG_I_(...) __ARG_N(__VA_ARGS__)
#define __ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
#define __RSEQ_N() 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
#define _VFUNC_(name, n) name##n
#define _VFUNC(name, n) _VFUNC_(name, n)
#define VFUNC(func, ...) _VFUNC(func, __NARG__(__VA_ARGS__)) (__VA_ARGS__)
#define FOR1(a) for (int _ = 0; _ < (a); _++)
#define FOR2(i, b) for (int i = 0; i < (b); i++)
#define FOR3(i, a, b) for (int i = (a); i < (b); i++)
#define ROF2(i, b) for (int i = (b) - 1; i >= 0; i--)
#define ROF3(i, a, b) for (int i = (b) - 1; i >= (a); i--)
#define each2(a, x) for (auto& a : x)
#define each3(a, b, x) for (auto& [a, b] : x)
#define each4(a, b, c, x) for (auto& [a, b, c] : x)
#define reach2(a, x) for (auto it = rbegin(x); it != rend(x); it++) if (auto& a = *it; 1)
#define reach3(a, x) for (auto it = rbegin(x); it != rend(x); it++) if (auto& [a, b] = *it; 1)
#define reach4(a, x) for (auto it = rbegin(x); it != rend(x); it++) if (auto& [a, b, c] = *it; 1)
#define enum3(i, a, x) if (int i = 0; 1) for (auto it = begin(x); it != end(x); it++, i++) if (auto& a = *it; 1)
#define enum4(i, a, b, x) if (int i = 0; 1) for (auto it = begin(x); it != end(x); it++, i++) if (auto& [a, b] = *it; 1)
#define enum5(i, a, b, c, x) if (int i = 0; 1) for (auto it = begin(x); it != end(x); it++, i++) if (auto& [a, b, c] = *it; 1)
#define renum3(i, a, x) if (int i = ((int) size(x)) - 1; 1) for (auto it = rbegin(x); it != rend(x); it++, i--) if (auto& a = *it; 1)
#define renum4(i, a, b, x) if (int i = ((int) size(x)) - 1; 1) for (auto it = rbegin(x); it != rend(x); it++, i--) if (auto& [a, b] = *it; 1)
#define renum5(i, a, b, c, x) if (int i = ((int) size(x)) - 1; 1) for (auto it = rbegin(x); it != rend(x); it++, i--) if (auto& [a, b, c] = *it; 1)
#define FOR(...) VFUNC(FOR, __VA_ARGS__)
#define ROF(...) VFUNC(ROF, __VA_ARGS__)
#define each(...) VFUNC(each, __VA_ARGS__)
#define reach(...) VFUNC(reach, __VA_ARGS__)
#define enum(...) VFUNC(enum, __VA_ARGS__)
#define renum(...) VFUNC(renum, __VA_ARGS__)
#define lam1(x) [&] () { return x; }
#define lam2(x, y) [&] (x) { return y;}
#define lam3(x, y, z) [&] (x, y) { return z; }
#define lam4(w, x, y, z) [&] (w, x, y) { return z; }
#define lam(...) VFUNC(lam, __VA_ARGS__)
__gnu_cxx::sfmt19937 mt((uint32_t) chrono::steady_clock::now().time_since_epoch().count());
ll mpow(ll x, ll y = mod - 2) {
ll res = 1;
for (; y; x = (x * x) % mod, y >>= 1) if (y & 1) res = (res * x) % mod;
return res;
}
ll mpow(ll x, ll y, ll mod) {
ll res = 1;
for (; y; x = (x * x) % mod, y >>= 1) if (y & 1) res = (res * x) % mod;
return res;
}
ll gen(ll l, ll r) { return uniform_int_distribution<ll>(l, r)(mt); }
int rs, cs;
const int dr[5] {0, -1, 0, 1, 0}, dc[5] {1, 0, -1, 0, 0};
bool valid(int r, int c) { return r >= 0 && c >= 0 && r < rs && c < cs; }
vpi get_adj(int r, int c) {
vpi ret(4);
FOR (i, 4) ret[i] = {r + dr[i], c + dc[i]};
return ret;
}
vpi get_valid_adj(int r, int c) {
vpi ret;
FOR (i, 4) {
int nr = r + dr[i];
int nc = c + dc[i];
if (valid(nr, nc)) ret.eb(nr, nc);
}
return ret;
}
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int pctl(ll x) { return __builtin_popcountll(x); }
// 2 ^ bits(n) is the largest power of 2 <= n
constexpr int bits(int x) { return x ? 31 - __builtin_clz(x) : 0; }
constexpr int bits(ll x) { return x ? 63 - __builtin_clzll(x) : 0; }
constexpr int p2(int x) { return 1 << x; }
constexpr ll p2l(int x) { return 1ll << x; }
constexpr int msk2(int x) { return p2(x) - 1; }
constexpr ll msk2l(int x) { return p2l(x) - 1; }
ll cdiv(ll a, ll b) { return a / b + ((a ^ b) > 0 && a % b); }
ll fdiv(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
namespace IO {
#ifndef LOCAL
const int BSZ = 1 << 15;
char ibuf[BSZ]; int ipos, ilen;
char _next_char() {
if (ipos == ilen) {
ipos = 0;
ilen = fread(ibuf, 1, BSZ, stdin);
if (!ilen) return EOF;
}
return ibuf[ipos++];
}
char _nc() {
char ch;
while (isspace(ch = _next_char()));
return ch;
}
void _rc(char& ch) {
while (isspace(ch = _next_char()));
}
string _ns() {
string x;
char ch; while (isspace(ch = _next_char()));
do { x += ch; } while (!isspace(ch = _next_char()) && ch != EOF);
return x;
}
void _rs(string& x) {
x.clear();
char ch; while (isspace(ch = _next_char()));
do { x += ch; } while (!isspace(ch = _next_char()) && ch != EOF);
}
int _ni() {
int x, sgn = 1;
char ch;
while (!isdigit(ch = _next_char())) if (ch == '-') sgn *= -1;
x = ch - '0';
while (isdigit(ch = _next_char())) x = x * 10 + (ch - '0');
return x * sgn;
}
ll _nl() {
ll x, sgn = 1;
char ch;
while (!isdigit(ch = _next_char())) if (ch == '-') sgn *= -1;
x = ch - '0';
while (isdigit(ch = _next_char())) x = x * 10 + (ch - '0');
return x * sgn;
}
template<class T> void _ri(T& x) {
char ch;
int sgn = 1;
while (!isdigit(ch = _next_char())) if (ch == '-') sgn *= -1;
x = ch - '0';
while (isdigit(ch = _next_char())) x = x * 10 + (ch - '0');
x *= sgn;
}
template<class T, class... Ts> void _ri(T& t, Ts&... ts) { _ri(t); _ri(ts...); }
char obuf[BSZ], numBuf[100]; int opos;
void flushOut() {
fwrite(obuf, 1, opos, stdout); opos = 0;
}
void _wc(char c) {
if (opos == BSZ) flushOut();
obuf[opos++] = c;
}
void _ws(string s) { for (char& c : s) _wc(c); }
template<class T> void _wi(T x) {
if (x < 0) _wc('-'), x *= -1;
int len = 0;
for (; x >= 10; x /= 10) numBuf[len++] = '0' + (x % 10);
_wc('0' + x);
for (int i = len - 1; i >= 0; i--) _wc(numBuf[i]);
}
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value>::type _rf(T &x) {
str in; _rs(in); x = stold(in);
}
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value>::type _wf(T& x) {
ostringstream sout;
sout << std::fixed << std::setprecision(precision) << x;
str out = sout.str();
each(c, out) _wc(c);
}
long double _nf() { long double x; _rf(x); return x; }
void initO() { assert(atexit(flushOut) == 0); }
#else
char _nc() { char ch; cin >> ch; return ch; }
void _rc(char& ch) { cin >> ch; }
string _ns() { string x; cin >> x; return x; }
void _rs(string& x) { cin >> x; }
int _ni() { int x; cin >> x; return x; }
ll _nl() { ll x; cin >> x; return x; }
template<class T> void _ri(T& x) { cin >> x; }
template<class T, class... Ts> void _ri(T& t, Ts&... ts) { ri(t); ri(ts...); }
void _wc(char c) {
if (c == '\n') cout << endl;
else cout << c;
}
void _ws(string s) { cout << s; }
template<class T> void _wi(T x) { cout << x; }
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value>::type _rf(T &x) { cin >> x; }
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value>::type _wf(T& x) { cout << std::fixed << std::setprecision(precision) << x; }
long double _nf() { long double x; _rf(x); return x; }
void initO() { cin.tie(0)->sync_with_stdio(0); }
#endif
}
void setfileaio(string name) {
#ifndef LOCAL
if (name == "") return;
freopen((name + "in.txt").c_str(), "r", stdin);
freopen((name + "out.txt").c_str(), "w", stdout);
#endif
}
void setfile(string pfx) {
#ifndef LOCAL
if (pfx == "") return;
freopen((pfx + ".in").c_str(), "r", stdin);
freopen((pfx + ".out").c_str(), "w", stdout);
#endif
}
template<typename... Args> // tuples
ostream& operator<<(ostream& os, tuple<Args...> t) {
apply([&](Args... args) { string dlm = "{"; ((os << dlm << args, dlm = ", "), ...); }, t);
return os << "}";
}
template<typename T, typename V> // pairs
ostream& operator<<(ostream& os, pair<T, V> p) { return os << "{" << p.f << ", " << p.s << "}"; }
template<typename T, typename V>
istream& operator>>(istream& os, pair<T, V> p) { return os >> p.f >> p.s; }
template<class T, class = decltype(begin(declval<T>()))> // iterables
typename enable_if<!is_same<T, string>::value, ostream&>::type operator<<(ostream& os, const T& v) {
os << "{";
string dlm = "";
for (auto i : v) os << dlm << i, dlm = ", ";
return os << "}";
}
void read(char& x) { x = IO::_nc(); }
template<typename T>
typename enable_if<is_integral<T>::value>::type read(T& x) { IO::_ri(x); }
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value>::type read(T &x) { IO::_rf(x); }
void read(bool& x) { char c; read(c); x = (c == '1'); }
void read(string& x) { IO::_rs(x); }
template<typename... Args>
void read(tuple<Args...>& t) { apply([&](Args&... args) {((read(args)), ...); }, t); }
template<class T, class U> void read(pair<T, U>& x) { read(x.f); read(x.s); }
template<class T, class = decltype(begin(declval<T>()))>
typename enable_if<!is_same<T, string>::value>::type read(T& v) { for (auto& i : v) read(i); }
template<class T, class... Ts> void read(T& t, Ts&... ts) { read(t); read(ts...); }
void _print(const char& c) { IO::_wc(c); }
template<typename T>
typename enable_if<is_integral<T>::value>::type _print(T x) { IO::_wi(x); }
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value>::type _print(T& x) { IO::_wf(x); }
void _print(const bool& x) { IO::_wi(x); }
void _print(const string& x) { IO::_ws(x); }
void _print(const char* x) { IO::_ws(x); }
template<typename... Args>
void _print(tuple<Args...> t) { string delim = ""; apply([&](Args... args) {((_print(delim), _print(args), delim = ' '), ...); }, t); }
template<class T, class U>
void _print(const pair<T, U>& x) { _print(x.first); _print(' '); _print(x.second); }
template<class T, class = decltype(begin(declval<T>()))>
typename enable_if<!is_same<T, string>::value>::type _print(const T& v) { each(i, v) _print(i), _print(' '); }
template<class T> void print(const T& t) { _print(t); _print(' '); }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { _print(t); _print(' '); print(ts...); }
template <typename T>
void print(initializer_list<T> args) { each(e, args) _print(e); }
void println() { _print('\n'); }
template<class T> void println(const T& t) { _print(t); _print('\n'); }
template<class T, class... Ts> void println(const T& t, const Ts&... ts) { _print(t); _print(' '); println(ts...); }
template<class T>
void println(initializer_list<T> args) { each(e, args) _print(e); _print('\n'); }
int nxti() { return IO::_ni(); }
ll nxtl() { return IO::_nl(); }
char nxtc() { return IO::_nc(); }
#define ri1(a) int a = IO::_ni()
#define ri2(a, b) int a = IO::_ni(); int b = IO::_ni()
#define ri3(a, b, c) int a = IO::_ni(); int b = IO::_ni(); int c = IO::_ni()
#define ri4(a, b, c, d) int a = IO::_ni(); int b = IO::_ni(); int c = IO::_ni(); int d = IO::_ni()
#define rid1(a) int a = IO::_ni() - 1
#define rid2(a, b) int a = IO::_ni() - 1; int b = IO::_ni() - 1
#define rid3(a, b, c) int a = IO::_ni() - 1; int b = IO::_ni() - 1; int c = IO::_ni() - 1
#define rid4(a, b, c, d) int a = IO::_ni() - 1; int b = IO::_ni() - 1; int c = IO::_ni() - 1; int d = IO::_ni() - 1
#define rl1(a) ll a = IO::_nl()
#define rl2(a, b) ll a = IO::_nl(); ll b = IO::_nl()
#define rl3(a, b, c) ll a = IO::_nl(); ll b = IO::_nl(); ll c = IO::_nl()
#define rl4(a, b, c, d) ll a = IO::_nl(); ll b = IO::_nl(); ll c = IO::_nl(); ll d = IO::_nl()
#define rd1(a) db a = IO::_nf()
#define rd2(a, b) db a = IO::_nf(); db b = IO::_nf()
#define rd3(a, b, c) db a = IO::_nf(); db b = IO::_nf(); db c = IO::_nf()
#define rd4(a, b, c, d) db a = IO::_nf(); db b = IO::_nf(); db c = IO::_nf(), db d = IO::_nf()
#define rc1(a) char a = IO::_nc()
#define rc2(a, b) char a = IO::_nc(); char b = IO::_nc()
#define rc3(a, b, c) char a = IO::_nc(); char b = IO::_nc(); char c = IO::_nc()
#define rc4(a, b, c, d) char a = IO::_nc(); char b = IO::_nc(); char c = IO::_nc(); char d = IO::_nc()
#define rs1(a) string a = IO::_ns()
#define rs2(a, b) string a = IO::_ns(); string b = IO::_ns()
#define rvi(a, n) vi a(n); FOR (i, n) IO::_ri(a[i])
#define rvid(a, n) vi a(n); FOR (i, n) IO::_ri(a[i]), a[i]--;
#define rvl(a, n) vl a(n); FOR (i, n) IO::_ri(a[i])
#define rvb(a, n) vb a(n); FOR (i, n) a[i] = (nxtc() == '1')
#define ri(...) VFUNC(ri, __VA_ARGS__)
#define rid(...) VFUNC(rid, __VA_ARGS__)
#define rl(...) VFUNC(rl, __VA_ARGS__)
#define rd(...) VFUNC(rd, __VA_ARGS__)
#define rc(...) VFUNC(rc, __VA_ARGS__)
#define rs(...) VFUNC(rs, __VA_ARGS__)
const int inf = 1e9;
const ll INF = 1e18;
const db eps = 1e-9;
vi make_perm(int n) { vi ret(n); iota(all(ret), 0); return ret; } // TODO: make this better
template<class T> bool chmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
int YES() { println("YES"); return 0; }
int NO() { println("NO"); return 0; }
int Yes() { println("Yes"); return 0; }
int No() { println("No"); return 0; }
#define ret(x) { x; return; }
#define exit(x) { x; exit(0); }
#ifdef LOCAL
template <typename T, typename... V>
void printer(string pfx, const char *names, T&& head, V&& ...tail) {
int i = 0, brackets = 0;
while (names[i] && (names[i] != ',' || brackets)) {
if (names[i] == '(' || names[i] == '{') brackets++;
if (names[i] == ')' || names[i] == '}') brackets--;
i++;
}
constexpr bool is_str = is_same_v<decay_t<T>, const char*>;
if (is_str) cerr << " " << head;
else cerr << pfx, cerr.write(names, i) << " = " << head;
if constexpr (sizeof...(tail)) printer(is_str ? "" : ",", names + i + 1, tail...);
else cerr << endl;
}
#define dbg(...) printer(to_string(__LINE__) + ": ", #__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(x...)
#define cerr if (0) std::cerr
#endif
/*
*/
struct Solver {
void sovle() {
ri(n);
vvi adj(n);
FOR (i, 1, n) {
rid(p); adj[p].pb(i);
}
vi sz(n, 1), min_free(n);
ROF (u, n) {
if (size(adj[u]) == 0) {
min_free[u] = 1;
continue;
}
each (v, adj[u]) sz[u] += sz[v];
sort(all(adj[u]), [&] (int i, int j) { return min_free[i] > min_free[j]; });
int tot_free = 0;
for (int v : adj[u]) tot_free += min_free[v];
dbg(u, min_free[adj[u][0]], tot_free);
if (2 * min_free[adj[u][0]] > tot_free) {
dbg("c1");
min_free[u] = 2 * min_free[adj[u][0]] - tot_free;
for (int v : adj[u]) {
if (v == adj[u][0]) continue;
int rem = min(min_free[u], sz[v] - min_free[v]) & ~1;
min_free[u] -= rem;
}
} else {
if (size(adj[u]) > 1)
min_free[u] = tot_free % 2;
else
min_free[u] = tot_free;
}
min_free[u]++;
dbg(u, min_free[u]);
}
cout << (n - min_free[0]) / 2 << '\n';
}
};
signed main() {
IO::initO();
ri(t);
FOR (i, t) {
Solver solver {};
solver.sovle();
}
}
Submission Info
Submission Time |
|
Task |
D - Non-Ancestor Matching |
User |
caterpillow |
Language |
C++ 23 (gcc 12.2) |
Score |
600 |
Code Size |
19518 Byte |
Status |
AC |
Exec Time |
67 ms |
Memory |
34612 KiB |
Compile Error
Main.cpp: In instantiation of ‘void IO::_wi(T) [with T = bool]’:
Main.cpp:369:37: required from here
Main.cpp:271:15: warning: comparison of constant ‘0’ with boolean expression is always false [-Wbool-compare]
271 | if (x < 0) _wc('-'), x *= -1;
| ~~^~~
Main.cpp:271:32: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
271 | if (x < 0) _wc('-'), x *= -1;
| ~~^~~~~
Main.cpp:273:18: warning: comparison of constant ‘10’ with boolean expression is always false [-Wbool-compare]
273 | for (; x >= 10; x /= 10) numBuf[len++] = '0' + (x % 10);
| ~~^~~~~
Main.cpp: In function ‘void setfileaio(std::string)’:
Main.cpp:317:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
317 | freopen((name + "in.txt").c_str(), "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:318:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
318 | freopen((name + "out.txt").c_str(), "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp: In function ‘void setfile(std::string)’:
Main.cpp:325:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
325 | freopen((pfx + ".in").c_str(), "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:326:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
326 | freopen((pfx + ".out").c_str(), "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
600 / 600 |
Status |
|
|
Set Name |
Test Cases |
Sample |
00_sample_00.txt |
All |
00_sample_00.txt, 01_small_00.txt, 01_small_01.txt, 01_small_02.txt, 02_handmade_00.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt, 02_handmade_06.txt, 02_handmade_07.txt, 02_handmade_08.txt, 02_handmade_09.txt, 02_handmade_10.txt, 02_handmade_11.txt, 02_handmade_12.txt, 02_handmade_13.txt, 02_handmade_14.txt, 02_handmade_15.txt, 02_handmade_16.txt, 02_handmade_17.txt, 02_handmade_18.txt, 02_handmade_19.txt, 02_handmade_20.txt, 02_handmade_21.txt, 02_handmade_22.txt, 02_handmade_23.txt, 02_handmade_24.txt, 02_handmade_25.txt, 02_handmade_26.txt, 02_handmade_27.txt, 02_handmade_28.txt, 02_handmade_29.txt, 02_handmade_30.txt, 02_handmade_31.txt, 02_handmade_32.txt, 02_handmade_33.txt, 02_handmade_34.txt, 02_handmade_35.txt, 02_handmade_36.txt, 02_handmade_37.txt, 02_handmade_38.txt, 02_handmade_39.txt, 02_handmade_40.txt, 02_handmade_41.txt, 02_handmade_42.txt, 02_handmade_43.txt, 02_handmade_44.txt, 02_handmade_45.txt, 03_random_00.txt, 03_random_01.txt, 03_random_02.txt, 03_random_03.txt, 03_random_04.txt, 03_random_05.txt, 03_random_06.txt, 03_random_07.txt, 03_random_08.txt, 03_random_09.txt, 03_random_10.txt, 03_random_11.txt, 03_random_12.txt, 03_random_13.txt, 03_random_14.txt, 03_random_15.txt, 03_random_16.txt, 03_random_17.txt, 03_random_18.txt, 03_random_19.txt, 03_random_20.txt, 03_random_21.txt, 03_random_22.txt, 03_random_23.txt, 03_random_24.txt, 03_random_25.txt, 03_random_26.txt, 04_from_path_subtree_01.txt, 04_from_path_subtree_02.txt, 04_from_path_subtree_03.txt, 04_from_path_subtree_04.txt, 04_from_path_subtree_05.txt, 04_from_path_subtree_06.txt, 04_from_path_subtree_07.txt, 04_from_path_subtree_08.txt, 04_from_path_subtree_09.txt, 04_from_path_subtree_10.txt |
Case Name |
Status |
Exec Time |
Memory |
00_sample_00.txt |
AC |
1 ms |
3616 KiB |
01_small_00.txt |
AC |
17 ms |
3424 KiB |
01_small_01.txt |
AC |
24 ms |
3552 KiB |
01_small_02.txt |
AC |
24 ms |
3628 KiB |
02_handmade_00.txt |
AC |
18 ms |
20952 KiB |
02_handmade_01.txt |
AC |
30 ms |
34528 KiB |
02_handmade_02.txt |
AC |
27 ms |
26560 KiB |
02_handmade_03.txt |
AC |
26 ms |
26612 KiB |
02_handmade_04.txt |
AC |
26 ms |
26696 KiB |
02_handmade_05.txt |
AC |
26 ms |
26696 KiB |
02_handmade_06.txt |
AC |
30 ms |
34592 KiB |
02_handmade_07.txt |
AC |
53 ms |
26908 KiB |
02_handmade_08.txt |
AC |
52 ms |
26920 KiB |
02_handmade_09.txt |
AC |
51 ms |
27028 KiB |
02_handmade_10.txt |
AC |
31 ms |
3652 KiB |
02_handmade_11.txt |
AC |
31 ms |
3688 KiB |
02_handmade_12.txt |
AC |
32 ms |
3644 KiB |
02_handmade_13.txt |
AC |
31 ms |
3524 KiB |
02_handmade_14.txt |
AC |
31 ms |
3644 KiB |
02_handmade_15.txt |
AC |
31 ms |
3728 KiB |
02_handmade_16.txt |
AC |
31 ms |
3600 KiB |
02_handmade_17.txt |
AC |
31 ms |
3748 KiB |
02_handmade_18.txt |
AC |
53 ms |
26820 KiB |
02_handmade_19.txt |
AC |
31 ms |
3668 KiB |
02_handmade_20.txt |
AC |
32 ms |
3688 KiB |
02_handmade_21.txt |
AC |
31 ms |
3724 KiB |
02_handmade_22.txt |
AC |
31 ms |
3684 KiB |
02_handmade_23.txt |
AC |
23 ms |
3656 KiB |
02_handmade_24.txt |
AC |
23 ms |
3816 KiB |
02_handmade_25.txt |
AC |
22 ms |
3704 KiB |
02_handmade_26.txt |
AC |
23 ms |
3692 KiB |
02_handmade_27.txt |
AC |
29 ms |
3668 KiB |
02_handmade_28.txt |
AC |
29 ms |
3608 KiB |
02_handmade_29.txt |
AC |
29 ms |
3600 KiB |
02_handmade_30.txt |
AC |
29 ms |
3808 KiB |
02_handmade_31.txt |
AC |
30 ms |
34524 KiB |
02_handmade_32.txt |
AC |
30 ms |
34560 KiB |
02_handmade_33.txt |
AC |
31 ms |
34460 KiB |
02_handmade_34.txt |
AC |
31 ms |
34484 KiB |
02_handmade_35.txt |
AC |
31 ms |
34536 KiB |
02_handmade_36.txt |
AC |
31 ms |
34524 KiB |
02_handmade_37.txt |
AC |
31 ms |
34528 KiB |
02_handmade_38.txt |
AC |
31 ms |
34192 KiB |
02_handmade_39.txt |
AC |
32 ms |
34612 KiB |
02_handmade_40.txt |
AC |
31 ms |
34296 KiB |
02_handmade_41.txt |
AC |
31 ms |
34528 KiB |
02_handmade_42.txt |
AC |
31 ms |
34572 KiB |
02_handmade_43.txt |
AC |
31 ms |
34544 KiB |
02_handmade_44.txt |
AC |
32 ms |
34428 KiB |
02_handmade_45.txt |
AC |
16 ms |
15516 KiB |
03_random_00.txt |
AC |
65 ms |
26796 KiB |
03_random_01.txt |
AC |
67 ms |
26824 KiB |
03_random_02.txt |
AC |
67 ms |
26792 KiB |
03_random_03.txt |
AC |
66 ms |
26880 KiB |
03_random_04.txt |
AC |
65 ms |
26936 KiB |
03_random_05.txt |
AC |
65 ms |
26936 KiB |
03_random_06.txt |
AC |
65 ms |
26868 KiB |
03_random_07.txt |
AC |
65 ms |
26904 KiB |
03_random_08.txt |
AC |
67 ms |
26872 KiB |
03_random_09.txt |
AC |
67 ms |
26868 KiB |
03_random_10.txt |
AC |
19 ms |
20916 KiB |
03_random_11.txt |
AC |
21 ms |
21024 KiB |
03_random_12.txt |
AC |
20 ms |
21916 KiB |
03_random_13.txt |
AC |
20 ms |
21860 KiB |
03_random_14.txt |
AC |
32 ms |
3592 KiB |
03_random_15.txt |
AC |
32 ms |
3656 KiB |
03_random_16.txt |
AC |
33 ms |
3624 KiB |
03_random_17.txt |
AC |
32 ms |
3680 KiB |
03_random_18.txt |
AC |
32 ms |
3628 KiB |
03_random_19.txt |
AC |
33 ms |
34580 KiB |
03_random_20.txt |
AC |
33 ms |
34552 KiB |
03_random_21.txt |
AC |
33 ms |
34492 KiB |
03_random_22.txt |
AC |
33 ms |
34576 KiB |
03_random_23.txt |
AC |
33 ms |
34536 KiB |
03_random_24.txt |
AC |
33 ms |
34528 KiB |
03_random_25.txt |
AC |
31 ms |
34608 KiB |
03_random_26.txt |
AC |
30 ms |
34592 KiB |
04_from_path_subtree_01.txt |
AC |
37 ms |
30248 KiB |
04_from_path_subtree_02.txt |
AC |
34 ms |
31628 KiB |
04_from_path_subtree_03.txt |
AC |
33 ms |
32628 KiB |
04_from_path_subtree_04.txt |
AC |
36 ms |
31056 KiB |
04_from_path_subtree_05.txt |
AC |
33 ms |
31972 KiB |
04_from_path_subtree_06.txt |
AC |
31 ms |
33688 KiB |
04_from_path_subtree_07.txt |
AC |
35 ms |
31096 KiB |
04_from_path_subtree_08.txt |
AC |
33 ms |
32684 KiB |
04_from_path_subtree_09.txt |
AC |
39 ms |
30840 KiB |
04_from_path_subtree_10.txt |
AC |
31 ms |
33396 KiB |