#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
using db = long double; // or double, if TL is tight
using str = string; // yay python!
// pairs
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
#define mp make_pair
#define f first
#define s second
#define tcT template <class T
#define tcTU tcT, class U
// ^ lol this makes everything look weird but I'll try it
tcT > using V = vector<T>;
tcT, size_t SZ > using AR = array<T, SZ>;
using vi = V<int>;
using vb = V<bool>;
using vl = V<ll>;
using vd = V<db>;
using vs = V<str>;
using vpi = V<pi>;
using vpl = V<pl>;
using vpd = V<pd>;
// vectors
// oops size(x), rbegin(x), rend(x) need C++17
#define sz(x) int((x).size())
#define bg(x) begin(x)
#define all(x) bg(x), end(x)
#define rall(x) x.rbegin(), x.rend()
#define sor(x) sort(all(x))
#define rsz resize
#define ins insert
#define pb push_back
#define eb emplace_back
#define ft front()
#define bk back()
#define lb lower_bound
#define ub upper_bound
tcT > int lwb(V<T> &a, const T &b) { return int(lb(all(a), b) - bg(a)); }
tcT > int upb(V<T> &a, const T &b) { return int(ub(all(a), b) - bg(a)); }
// loops
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i, 0, a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i, 0, a)
#define rep(a) F0R(_, a)
#define each(a, x) for (auto &a : x)
const int MOD = (int)1e9 + 7; // 998244353;
const int MX = (int)2e5 + 5;
const ll BIG = 1e18; // not too close to LLONG_MAX
const db PI = acos((db)-1);
const int dx[4]{1, 0, -1, 0}, dy[4]{0, 1, 0, -1}; // for every grid problem!!
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
template <class T> using pqg = priority_queue<T, vector<T>, greater<T>>;
// bitwise ops
// also see https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
constexpr int pct(int x) { return __builtin_popcount(x); } // # of bits set
constexpr int bits(int x) { // assert(x >= 0); // make C++11 compatible until
// USACO updates ...
return x == 0 ? 0 : 31 - __builtin_clz(x);
} // floor(log2(x))
constexpr int p2(int x) { return 1 << x; }
constexpr int msk2(int x) { return p2(x) - 1; }
ll cdiv(ll a, ll b) {
return a / b + ((a ^ b) > 0 && a % b);
} // divide a by b rounded up
ll fdiv(ll a, ll b) {
return a / b - ((a ^ b) < 0 && a % b);
} // divide a by b rounded down
tcT > bool ckmin(T &a, const T &b) {
return b < a ? a = b, 1 : 0;
} // set a = min(a,b)
tcT > bool ckmax(T &a, const T &b) {
return a < b ? a = b, 1 : 0;
} // set a = max(a,b)
tcTU > T fstTrue(T lo, T hi, U f) {
++hi;
assert(lo <= hi); // assuming f is increasing
while (lo < hi) { // find first index such that f is true
T mid = lo + (hi - lo) / 2;
f(mid) ? hi = mid : lo = mid + 1;
}
return lo;
}
tcTU > T lstTrue(T lo, T hi, U f) {
--lo;
assert(lo <= hi); // assuming f is decreasing
while (lo < hi) { // find first index such that f is true
T mid = lo + (hi - lo + 1) / 2;
f(mid) ? lo = mid : hi = mid - 1;
}
return lo;
}
tcT > void remDup(vector<T> &v) { // sort and remove duplicates
sort(all(v));
v.erase(unique(all(v)), end(v));
}
tcTU > void safeErase(T &t, const U &u) {
auto it = t.find(u);
assert(it != end(t));
t.erase(it);
}
inline namespace IO {
#define SFINAE(x, ...) \
template <class, class = void> struct x : std::false_type {}; \
template <class T> struct x<T, std::void_t<__VA_ARGS__>> : std::true_type {}
SFINAE(DefaultI, decltype(std::cin >> std::declval<T &>()));
SFINAE(DefaultO, decltype(std::cout << std::declval<T &>()));
SFINAE(IsTuple, typename std::tuple_size<T>::type);
SFINAE(Iterable, decltype(std::begin(std::declval<T>())));
template <class T> constexpr char Space(const T &) {
return (Iterable<T>::value or IsTuple<T>::value) ? '\n' : ' ';
}
template <auto &is> struct Reader {
template <class T> void Impl(T &t) {
if constexpr (DefaultI<T>::value) is >> t;
else if constexpr (Iterable<T>::value) {
for (auto &x : t) Impl(x);
} else if constexpr (IsTuple<T>::value) {
std::apply([this](auto &...args) { (Impl(args), ...); }, t);
} else static_assert(IsTuple<T>::value, "No matching type for read");
}
template <class... Ts> void read(Ts &...ts) { ((Impl(ts)), ...); }
};
template <class... Ts> void re(Ts &...ts) { Reader<cin>{}.read(ts...); }
#define def(t, args...) \
t args; \
re(args);
template <auto &os, bool debug> struct Writer {
string comma() const { return debug ? "," : ""; }
template <class T> void Impl(T const &t) const {
if constexpr (DefaultO<T>::value) os << t;
else if constexpr (Iterable<T>::value) {
if (debug) os << '{';
int i = 0;
for (auto &&x : t)
((i++) ? (os << comma() << Space(x), Impl(x)) : Impl(x));
if (debug) os << '}';
} else if constexpr (IsTuple<T>::value) {
if (debug) os << '(';
std::apply(
[this](auto const &...args) {
int i = 0;
(((i++) ? (os << comma() << " ", Impl(args)) : Impl(args)),
...);
},
t);
if (debug) os << ')';
} else static_assert(IsTuple<T>::value, "No matching type for print");
}
template <class T> void ImplWrapper(T const &t) const {
if (debug) os << "\033[0;31m";
Impl(t);
if (debug) os << "\033[0m";
}
template <class... Ts> void print(Ts const &...ts) const {
((Impl(ts)), ...);
}
template <class F, class... Ts>
void print_with_sep(const std::string &sep, F const &f,
Ts const &...ts) const {
ImplWrapper(f), ((os << sep, ImplWrapper(ts)), ...), os << '\n';
}
void print_with_sep(const std::string &) const { os << '\n'; }
};
template <class... Ts> void pr(Ts const &...ts) {
Writer<cout, false>{}.print(ts...);
}
template <class... Ts> void ps(Ts const &...ts) {
Writer<cout, false>{}.print_with_sep(" ", ts...);
}
} // namespace IO
inline namespace Debug {
template <typename... Args> void err(Args... args) {
Writer<cerr, true>{}.print_with_sep(" | ", args...);
}
void err_prefix(str func, int line, string args) {
cerr << "\033[0;31m\u001b[1mDEBUG\033[0m"
<< " | "
<< "\u001b[34m" << func << "\033[0m"
<< ":"
<< "\u001b[34m" << line << "\033[0m"
<< " - "
<< "[" << args << "] = ";
}
#ifdef LOCAL
#define dbg(args...) err_prefix(__FUNCTION__, __LINE__, #args), err(args)
#else
#define dbg(...)
#endif
const auto beg_time = std::chrono::high_resolution_clock::now();
// https://stackoverflow.com/questions/47980498/accurate-c-c-clock-on-a-multi-core-processor-with-auto-overclock?noredirect=1&lq=1
double time_elapsed() {
return chrono::duration<double>(std::chrono::high_resolution_clock::now() -
beg_time)
.count();
}
} // namespace Debug
inline namespace FileIO {
void setIn(str s) { freopen(s.c_str(), "r", stdin); }
void setOut(str s) { freopen(s.c_str(), "w", stdout); }
void setIO(str s = "") {
cin.tie(0)->sync_with_stdio(0); // unsync C / C++ I/O streams
cout << fixed << setprecision(12);
// cin.exceptions(cin.failbit);
// throws exception when do smth illegal
// ex. try to read letter into int
if (sz(s)) setIn(s + ".in"), setOut(s + ".out"); // for old USACO
}
} // namespace FileIO
#include "soccer.h"
/**
* Description: 1D range minimum query. If TL is an issue, use
* arrays instead of vectors and store values instead of indices.
* Source: KACTL
* Verification:
* https://cses.fi/problemset/stats/1647/
* http://wcipeg.com/problem/ioi1223
* https://pastebin.com/ChpniVZL
* Memory: O(N\log N)
* Time: O(1)
*/
tcT > struct RMQ { // floor(log_2(x))
int level(int x) { return 31 - __builtin_clz(x); }
V<T> v;
V<vi> jmp;
int cmb(int a, int b) {
return v[a] == v[b] ? min(a, b) : (v[a] < v[b] ? a : b);
}
void init(const V<T> &_v) {
v = _v;
jmp = {vi(sz(v))};
iota(all(jmp[0]), 0);
for (int j = 1; 1 << j <= sz(v); ++j) {
jmp.pb(vi(sz(v) - (1 << j) + 1));
F0R(i, sz(jmp[j]))
jmp[j][i] = cmb(jmp[j - 1][i], jmp[j - 1][i + (1 << (j - 1))]);
}
}
int index(int l, int r) {
assert(l <= r);
int d = level(r - l + 1);
return cmb(jmp[d][l], jmp[d][r - (1 << d) + 1]);
}
T query(int l, int r) { return v[index(l, r)]; }
};
tcT > struct RMaxQ { // floor(log_2(x))
int level(int x) { return 31 - __builtin_clz(x); }
V<T> v;
V<vi> jmp;
int cmb(int a, int b) {
return v[a] == v[b] ? min(a, b) : (v[a] > v[b] ? a : b);
}
void init(const V<T> &_v) {
v = _v;
jmp = {vi(sz(v))};
iota(all(jmp[0]), 0);
for (int j = 1; 1 << j <= sz(v); ++j) {
jmp.pb(vi(sz(v) - (1 << j) + 1));
F0R(i, sz(jmp[j]))
jmp[j][i] = cmb(jmp[j - 1][i], jmp[j - 1][i + (1 << (j - 1))]);
}
}
int index(int l, int r) {
assert(l <= r);
int d = level(r - l + 1);
return cmb(jmp[d][l], jmp[d][r - (1 << d) + 1]);
}
T query(int l, int r) { return v[index(l, r)]; }
};
int biggest_stadium(int N, std::vector<std::vector<int>> F) {
V<vi> row(N, vi(N, -1)), col(N, vi(N, -1));
F0R(r, N) {
F0R(c, N) {
if (F[r][c]) {
row[r][c] = c;
col[r][c] = r;
} else {
if (c) row[r][c] = row[r][c - 1];
if (r) col[r][c] = col[r - 1][c];
}
}
}
auto empty = [&](int r, int c1, int c2) { return row.at(r).at(c2) < c1; };
V<pair<pi, pi>> rects;
auto cand_rect = [&](pi x, pi y) {
if (x.s == N - 1 || row.at(x.s + 1).at(y.s) >= y.f) {
rects.pb({x, y});
}
};
F0R(r, N) {
vpi stk{{r, -1}};
F0R(c, N) {
// dbg(r, c, col[r][c]);
while (sz(stk) && stk.bk.f <= col[r][c]) {
auto p = stk.bk;
stk.pop_back();
if (sz(stk) && p.f < col[r][c]) {
// dbg("HA", p, col[r][c]);
cand_rect({p.f + 1, r}, {stk.bk.s + 1, c - 1});
}
}
stk.pb({col[r][c], c});
}
while (sz(stk)) {
auto p = stk.bk;
stk.pop_back();
if (sz(stk)) {
// dbg("HA", p, col[r][c]);
cand_rect({p.f + 1, r}, {stk.bk.s + 1, N - 1});
}
}
}
auto height = [&](const auto &a) { return a.f.s - a.f.f + 1; };
auto width = [&](const auto &a) { return a.s.s - a.s.f + 1; };
sort(all(rects), [](const auto &a, const auto &b) {
return a.s.s - a.s.f + 1 < b.s.s - b.s.f + 1;
});
V<pair<pair<pi, pi>, int>> order;
F0R(i, sz(rects)) { order.pb({rects[i], i}); }
auto locate = [&](pair<pi, pi> p) {
// dbg("LOCATE", p);
int i = lwb(order, {p, 0});
assert(order.at(i).f == p);
// dbg("DONE LOCATE");
return order.at(i).s;
};
sor(order);
auto contains = [&](pi a, pi b) {
return a.f <= b.f && b.s <= a.s && a != b;
};
V<RMaxQ<int>> r_max_q(N);
V<RMQ<int>> r_min_q(N);
F0R(r, N) { r_max_q[r].init(col[r]); }
{
V<vi> ncol(N + 1, vi(N, N));
R0F(r, N) {
F0R(c, N) {
if (F[r][c]) ncol[r][c] = r;
else ncol[r][c] = ncol[r + 1][c];
}
r_min_q[r].init(ncol[r]);
}
}
vi dp(sz(rects));
int ans = 0;
F0R(i, sz(rects)) {
int r1 = rects[i].f.f;
int r2 = rects[i].f.s;
int c1 = rects[i].s.f;
int c2 = rects[i].s.s;
auto cand_rect = [&](int c_lo, int c_hi) {
assert(c_lo <= c_hi);
int r_lo = r_max_q.at(r1).query(c_lo, c_hi) + 1;
int r_hi = r_min_q.at(r2).query(c_lo, c_hi) - 1;
int j = locate({{r_lo, r_hi}, {c_lo, c_hi}});
ckmax(dp[i], dp[j] + (height(rects[j]) - height(rects[i])) *
width(rects[j]));
};
// dbg("BEGIN");
for (int r : {r1 - 1, r2 + 1}) {
int c = c2 + 1;
while (c > c1) {
// dbg(r, c);
int prev_c =
((r < 0 || r >= N) ? c - 1
: max(row.at(r).at(c - 1), c1 - 1));
if (prev_c + 1 < c) { cand_rect(prev_c + 1, c - 1); }
c = prev_c;
}
// dbg("HI");
}
// dbg("END");
ckmax(ans, dp[i] + height(rects[i]) * width(rects[i]));
}
return ans;
}
Compilation message
soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int, std::allocator<int> > >)':
soccer.cpp:331:7: warning: variable 'empty' set but not used [-Wunused-but-set-variable]
331 | auto empty = [&](int r, int c1, int c2) { return row.at(r).at(c2) < c1; };
| ^~~~~
soccer.cpp:378:7: warning: variable 'contains' set but not used [-Wunused-but-set-variable]
378 | auto contains = [&](pi a, pi b) {
| ^~~~~~~~
soccer.cpp: In function 'void FileIO::setIn(str)':
soccer.cpp:242:28: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
242 | void setIn(str s) { freopen(s.c_str(), "r", stdin); }
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
soccer.cpp: In function 'void FileIO::setOut(str)':
soccer.cpp:243:29: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
243 | void setOut(str s) { freopen(s.c_str(), "w", stdout); }
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
ok |
2 |
Correct |
1 ms |
344 KB |
ok |
3 |
Correct |
0 ms |
344 KB |
ok |
4 |
Correct |
0 ms |
344 KB |
ok |
5 |
Correct |
1 ms |
344 KB |
ok |
6 |
Correct |
1 ms |
344 KB |
ok |
7 |
Correct |
2 ms |
1116 KB |
ok |
8 |
Correct |
35 ms |
23376 KB |
ok |
9 |
Correct |
550 ms |
425124 KB |
ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
ok |
2 |
Correct |
1 ms |
344 KB |
ok |
3 |
Correct |
1 ms |
344 KB |
ok |
4 |
Correct |
0 ms |
348 KB |
ok |
5 |
Correct |
0 ms |
344 KB |
ok |
6 |
Correct |
0 ms |
348 KB |
ok |
7 |
Correct |
1 ms |
344 KB |
ok |
8 |
Correct |
0 ms |
344 KB |
ok |
9 |
Correct |
1 ms |
348 KB |
ok |
10 |
Correct |
1 ms |
348 KB |
ok |
11 |
Correct |
0 ms |
344 KB |
ok |
12 |
Correct |
0 ms |
600 KB |
ok |
13 |
Correct |
0 ms |
344 KB |
ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
ok |
2 |
Correct |
1 ms |
344 KB |
ok |
3 |
Correct |
1 ms |
344 KB |
ok |
4 |
Correct |
1 ms |
344 KB |
ok |
5 |
Correct |
0 ms |
348 KB |
ok |
6 |
Correct |
0 ms |
344 KB |
ok |
7 |
Correct |
0 ms |
348 KB |
ok |
8 |
Correct |
1 ms |
344 KB |
ok |
9 |
Correct |
0 ms |
344 KB |
ok |
10 |
Correct |
1 ms |
348 KB |
ok |
11 |
Correct |
1 ms |
348 KB |
ok |
12 |
Correct |
0 ms |
344 KB |
ok |
13 |
Correct |
0 ms |
600 KB |
ok |
14 |
Correct |
0 ms |
344 KB |
ok |
15 |
Correct |
1 ms |
344 KB |
ok |
16 |
Correct |
0 ms |
344 KB |
ok |
17 |
Correct |
1 ms |
344 KB |
ok |
18 |
Correct |
0 ms |
600 KB |
ok |
19 |
Correct |
0 ms |
344 KB |
ok |
20 |
Correct |
0 ms |
348 KB |
ok |
21 |
Correct |
0 ms |
348 KB |
ok |
22 |
Correct |
0 ms |
344 KB |
ok |
23 |
Correct |
0 ms |
344 KB |
ok |
24 |
Correct |
0 ms |
344 KB |
ok |
25 |
Correct |
0 ms |
344 KB |
ok |
26 |
Correct |
1 ms |
348 KB |
ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
ok |
2 |
Correct |
1 ms |
344 KB |
ok |
3 |
Correct |
1 ms |
344 KB |
ok |
4 |
Correct |
0 ms |
344 KB |
ok |
5 |
Correct |
0 ms |
344 KB |
ok |
6 |
Correct |
1 ms |
344 KB |
ok |
7 |
Correct |
0 ms |
348 KB |
ok |
8 |
Correct |
0 ms |
344 KB |
ok |
9 |
Correct |
0 ms |
348 KB |
ok |
10 |
Correct |
1 ms |
344 KB |
ok |
11 |
Correct |
0 ms |
344 KB |
ok |
12 |
Correct |
1 ms |
348 KB |
ok |
13 |
Correct |
1 ms |
348 KB |
ok |
14 |
Correct |
0 ms |
344 KB |
ok |
15 |
Correct |
0 ms |
600 KB |
ok |
16 |
Correct |
0 ms |
344 KB |
ok |
17 |
Correct |
1 ms |
344 KB |
ok |
18 |
Correct |
0 ms |
344 KB |
ok |
19 |
Correct |
1 ms |
344 KB |
ok |
20 |
Correct |
0 ms |
600 KB |
ok |
21 |
Correct |
0 ms |
344 KB |
ok |
22 |
Correct |
0 ms |
348 KB |
ok |
23 |
Correct |
0 ms |
348 KB |
ok |
24 |
Correct |
0 ms |
344 KB |
ok |
25 |
Correct |
0 ms |
344 KB |
ok |
26 |
Correct |
0 ms |
344 KB |
ok |
27 |
Correct |
0 ms |
344 KB |
ok |
28 |
Correct |
1 ms |
348 KB |
ok |
29 |
Correct |
0 ms |
344 KB |
ok |
30 |
Correct |
1 ms |
348 KB |
ok |
31 |
Correct |
1 ms |
348 KB |
ok |
32 |
Correct |
1 ms |
600 KB |
ok |
33 |
Correct |
1 ms |
344 KB |
ok |
34 |
Correct |
0 ms |
348 KB |
ok |
35 |
Correct |
1 ms |
344 KB |
ok |
36 |
Correct |
0 ms |
348 KB |
ok |
37 |
Correct |
1 ms |
344 KB |
ok |
38 |
Correct |
1 ms |
344 KB |
ok |
39 |
Correct |
1 ms |
348 KB |
ok |
40 |
Correct |
1 ms |
344 KB |
ok |
41 |
Correct |
0 ms |
348 KB |
ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
ok |
2 |
Correct |
1 ms |
344 KB |
ok |
3 |
Correct |
1 ms |
344 KB |
ok |
4 |
Correct |
0 ms |
344 KB |
ok |
5 |
Correct |
0 ms |
344 KB |
ok |
6 |
Correct |
1 ms |
344 KB |
ok |
7 |
Correct |
0 ms |
348 KB |
ok |
8 |
Correct |
0 ms |
344 KB |
ok |
9 |
Correct |
0 ms |
348 KB |
ok |
10 |
Correct |
1 ms |
344 KB |
ok |
11 |
Correct |
0 ms |
344 KB |
ok |
12 |
Correct |
1 ms |
348 KB |
ok |
13 |
Correct |
1 ms |
348 KB |
ok |
14 |
Correct |
0 ms |
344 KB |
ok |
15 |
Correct |
0 ms |
600 KB |
ok |
16 |
Correct |
0 ms |
344 KB |
ok |
17 |
Correct |
1 ms |
344 KB |
ok |
18 |
Correct |
0 ms |
344 KB |
ok |
19 |
Correct |
1 ms |
344 KB |
ok |
20 |
Correct |
0 ms |
600 KB |
ok |
21 |
Correct |
0 ms |
344 KB |
ok |
22 |
Correct |
0 ms |
348 KB |
ok |
23 |
Correct |
0 ms |
348 KB |
ok |
24 |
Correct |
0 ms |
344 KB |
ok |
25 |
Correct |
0 ms |
344 KB |
ok |
26 |
Correct |
0 ms |
344 KB |
ok |
27 |
Correct |
0 ms |
344 KB |
ok |
28 |
Correct |
1 ms |
348 KB |
ok |
29 |
Correct |
0 ms |
344 KB |
ok |
30 |
Correct |
1 ms |
348 KB |
ok |
31 |
Correct |
1 ms |
348 KB |
ok |
32 |
Correct |
1 ms |
600 KB |
ok |
33 |
Correct |
1 ms |
344 KB |
ok |
34 |
Correct |
0 ms |
348 KB |
ok |
35 |
Correct |
1 ms |
344 KB |
ok |
36 |
Correct |
0 ms |
348 KB |
ok |
37 |
Correct |
1 ms |
344 KB |
ok |
38 |
Correct |
1 ms |
344 KB |
ok |
39 |
Correct |
1 ms |
348 KB |
ok |
40 |
Correct |
1 ms |
344 KB |
ok |
41 |
Correct |
0 ms |
348 KB |
ok |
42 |
Correct |
83 ms |
25156 KB |
ok |
43 |
Correct |
89 ms |
25800 KB |
ok |
44 |
Correct |
49 ms |
24084 KB |
ok |
45 |
Correct |
44 ms |
23816 KB |
ok |
46 |
Correct |
74 ms |
24644 KB |
ok |
47 |
Correct |
34 ms |
23380 KB |
ok |
48 |
Correct |
34 ms |
23376 KB |
ok |
49 |
Correct |
34 ms |
23632 KB |
ok |
50 |
Correct |
38 ms |
23376 KB |
ok |
51 |
Correct |
46 ms |
24196 KB |
ok |
52 |
Correct |
34 ms |
23376 KB |
ok |
53 |
Correct |
39 ms |
23380 KB |
ok |
54 |
Correct |
34 ms |
23376 KB |
ok |
55 |
Correct |
34 ms |
23376 KB |
ok |
56 |
Correct |
33 ms |
23384 KB |
ok |
57 |
Correct |
66 ms |
25664 KB |
ok |
58 |
Correct |
75 ms |
26040 KB |
ok |
59 |
Correct |
77 ms |
26452 KB |
ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
ok |
2 |
Correct |
1 ms |
344 KB |
ok |
3 |
Correct |
1 ms |
344 KB |
ok |
4 |
Correct |
0 ms |
344 KB |
ok |
5 |
Correct |
0 ms |
344 KB |
ok |
6 |
Correct |
1 ms |
344 KB |
ok |
7 |
Correct |
1 ms |
344 KB |
ok |
8 |
Correct |
2 ms |
1116 KB |
ok |
9 |
Correct |
35 ms |
23376 KB |
ok |
10 |
Correct |
550 ms |
425124 KB |
ok |
11 |
Correct |
1 ms |
344 KB |
ok |
12 |
Correct |
0 ms |
348 KB |
ok |
13 |
Correct |
0 ms |
344 KB |
ok |
14 |
Correct |
0 ms |
348 KB |
ok |
15 |
Correct |
1 ms |
344 KB |
ok |
16 |
Correct |
0 ms |
344 KB |
ok |
17 |
Correct |
1 ms |
348 KB |
ok |
18 |
Correct |
1 ms |
348 KB |
ok |
19 |
Correct |
0 ms |
344 KB |
ok |
20 |
Correct |
0 ms |
600 KB |
ok |
21 |
Correct |
0 ms |
344 KB |
ok |
22 |
Correct |
1 ms |
344 KB |
ok |
23 |
Correct |
0 ms |
344 KB |
ok |
24 |
Correct |
1 ms |
344 KB |
ok |
25 |
Correct |
0 ms |
600 KB |
ok |
26 |
Correct |
0 ms |
344 KB |
ok |
27 |
Correct |
0 ms |
348 KB |
ok |
28 |
Correct |
0 ms |
348 KB |
ok |
29 |
Correct |
0 ms |
344 KB |
ok |
30 |
Correct |
0 ms |
344 KB |
ok |
31 |
Correct |
0 ms |
344 KB |
ok |
32 |
Correct |
0 ms |
344 KB |
ok |
33 |
Correct |
1 ms |
348 KB |
ok |
34 |
Correct |
0 ms |
344 KB |
ok |
35 |
Correct |
1 ms |
348 KB |
ok |
36 |
Correct |
1 ms |
348 KB |
ok |
37 |
Correct |
1 ms |
600 KB |
ok |
38 |
Correct |
1 ms |
344 KB |
ok |
39 |
Correct |
0 ms |
348 KB |
ok |
40 |
Correct |
1 ms |
344 KB |
ok |
41 |
Correct |
0 ms |
348 KB |
ok |
42 |
Correct |
1 ms |
344 KB |
ok |
43 |
Correct |
1 ms |
344 KB |
ok |
44 |
Correct |
1 ms |
348 KB |
ok |
45 |
Correct |
1 ms |
344 KB |
ok |
46 |
Correct |
0 ms |
348 KB |
ok |
47 |
Correct |
83 ms |
25156 KB |
ok |
48 |
Correct |
89 ms |
25800 KB |
ok |
49 |
Correct |
49 ms |
24084 KB |
ok |
50 |
Correct |
44 ms |
23816 KB |
ok |
51 |
Correct |
74 ms |
24644 KB |
ok |
52 |
Correct |
34 ms |
23380 KB |
ok |
53 |
Correct |
34 ms |
23376 KB |
ok |
54 |
Correct |
34 ms |
23632 KB |
ok |
55 |
Correct |
38 ms |
23376 KB |
ok |
56 |
Correct |
46 ms |
24196 KB |
ok |
57 |
Correct |
34 ms |
23376 KB |
ok |
58 |
Correct |
39 ms |
23380 KB |
ok |
59 |
Correct |
34 ms |
23376 KB |
ok |
60 |
Correct |
34 ms |
23376 KB |
ok |
61 |
Correct |
33 ms |
23384 KB |
ok |
62 |
Correct |
66 ms |
25664 KB |
ok |
63 |
Correct |
75 ms |
26040 KB |
ok |
64 |
Correct |
77 ms |
26452 KB |
ok |
65 |
Correct |
1860 ms |
455624 KB |
ok |
66 |
Correct |
861 ms |
454480 KB |
ok |
67 |
Correct |
643 ms |
438688 KB |
ok |
68 |
Correct |
626 ms |
426848 KB |
ok |
69 |
Correct |
994 ms |
433236 KB |
ok |
70 |
Correct |
1320 ms |
440976 KB |
ok |
71 |
Correct |
612 ms |
426116 KB |
ok |
72 |
Correct |
560 ms |
425104 KB |
ok |
73 |
Correct |
583 ms |
425296 KB |
ok |
74 |
Correct |
567 ms |
425296 KB |
ok |
75 |
Correct |
559 ms |
425296 KB |
ok |
76 |
Correct |
650 ms |
425260 KB |
ok |
77 |
Correct |
656 ms |
425496 KB |
ok |
78 |
Correct |
649 ms |
433456 KB |
ok |
79 |
Correct |
610 ms |
428476 KB |
ok |
80 |
Correct |
598 ms |
426808 KB |
ok |
81 |
Correct |
616 ms |
426808 KB |
ok |
82 |
Correct |
680 ms |
429180 KB |
ok |
83 |
Correct |
832 ms |
437152 KB |
ok |
84 |
Correct |
556 ms |
425412 KB |
ok |
85 |
Correct |
563 ms |
425236 KB |
ok |
86 |
Correct |
560 ms |
425296 KB |
ok |
87 |
Correct |
567 ms |
425800 KB |
ok |
88 |
Correct |
600 ms |
425104 KB |
ok |
89 |
Correct |
553 ms |
425296 KB |
ok |
90 |
Correct |
552 ms |
425512 KB |
ok |
91 |
Correct |
560 ms |
425164 KB |
ok |
92 |
Correct |
678 ms |
432040 KB |
ok |
93 |
Correct |
667 ms |
433064 KB |
ok |
94 |
Correct |
599 ms |
427956 KB |
ok |
95 |
Correct |
589 ms |
426580 KB |
ok |
96 |
Correct |
579 ms |
426140 KB |
ok |
97 |
Correct |
575 ms |
425816 KB |
ok |
98 |
Correct |
553 ms |
425484 KB |
ok |
99 |
Correct |
1603 ms |
462436 KB |
ok |
100 |
Correct |
1339 ms |
461208 KB |
ok |
101 |
Correct |
1240 ms |
461240 KB |
ok |
102 |
Correct |
1334 ms |
464540 KB |
ok |
103 |
Correct |
1471 ms |
471652 KB |
ok |
104 |
Correct |
1530 ms |
474716 KB |
ok |
105 |
Correct |
1559 ms |
474700 KB |
ok |
106 |
Correct |
1637 ms |
477344 KB |
ok |
107 |
Correct |
1604 ms |
477332 KB |
ok |
108 |
Correct |
630 ms |
431372 KB |
ok |
109 |
Correct |
630 ms |
431540 KB |
ok |