#line 1 "paint.h"
#include <vector>
int minimumInstructions(
int N, int M, int K, std::vector<int> C,
std::vector<int> A, std::vector<std::vector<int>> B);
#line 2 "/Users/kaage/Desktop/ProgrammingWorkspace/library/other/template.hpp"
#define _CRT_SECURE_NO_WARNINGS
#ifndef __clang__
#ifdef ONLINE_JUDGE
#pragma GCC target("avx512f")
#elif defined EVAL
#else
#pragma GCC target("avx2")
#endif
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#endif
#include <string.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#line 41 "/Users/kaage/Desktop/ProgrammingWorkspace/library/other/template.hpp"
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define REP(i, n) for (int i = 1; i <= int(n); i++)
#define all(V) V.begin(), V.end()
using i128 = __int128_t;
using u128 = __uint128_t;
using uint = unsigned int;
using lint = long long;
using ulint = unsigned long long;
using IP = std::pair<int, int>;
using LP = std::pair<lint, lint>;
constexpr int INF = INT_MAX / 2;
constexpr lint LINF = LLONG_MAX / 2;
constexpr double eps = DBL_EPSILON;
constexpr double PI = 3.141592653589793238462643383279;
template <class T>
class prique : public std::priority_queue<T, std::vector<T>, std::greater<T>> {
};
int popcount(uint x) {
#if __cplusplus >= 202002L
return std::popcount(x);
#else
#ifndef __clang__
return __builtin_popcount(x);
#endif
#endif
x = (x & 0x55555555) + (x >> 1 & 0x55555555);
x = (x & 0x33333333) + (x >> 2 & 0x33333333);
x = (x & 0x0f0f0f0f) + (x >> 4 & 0x0f0f0f0f);
x = (x & 0x00ff00ff) + (x >> 8 & 0x00ff00ff);
return (x & 0x0000ffff) + (x >> 16 & 0x0000ffff);
}
template <class F>
inline constexpr decltype(auto) lambda_fix(F&& f) {
return [f = std::forward<F>(f)](auto&&... args) {
return f(f, std::forward<decltype(args)>(args)...);
};
}
template <class T>
constexpr std::vector<T> make_vec(size_t n) {
return std::vector<T>(n);
}
template <class T, class... Args>
constexpr auto make_vec(size_t n, Args&&... args) {
return std::vector<decltype(make_vec<T>(args...))>(
n, make_vec<T>(std::forward<Args>(args)...));
}
template <class T, class U>
std::istream& operator>>(std::istream& ist, std::pair<T, U>& x) {
return ist >> x.first >> x.second;
}
template <class T, class U>
std::ostream& operator<<(std::ostream& ost, const std::pair<T, U>& x) {
return ost << x.first << " " << x.second;
}
template <class T, class U>
constexpr inline bool chmax(T& lhs, const U& rhs) noexcept {
if (lhs < rhs) {
lhs = rhs;
return true;
}
return false;
}
template <class T, class U>
constexpr inline bool chmin(T& lhs, const U& rhs) noexcept {
if (lhs > rhs) {
lhs = rhs;
return true;
}
return false;
}
constexpr inline lint gcd(lint a, lint b) noexcept {
while (b) {
lint c = a;
a = b;
b = c % b;
}
return a;
}
inline lint lcm(lint a, lint b) noexcept { return a / gcd(a, b) * b; }
constexpr bool isprime(lint n) noexcept {
if (n == 1) return false;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) return false;
}
return true;
}
template <class T>
constexpr T mypow(T a, lint b) noexcept {
T res(1);
while (true) {
if (b & 1) res *= a;
b >>= 1;
if (!b) break;
a *= a;
}
return res;
}
constexpr lint modpow(lint a, lint b, lint m) noexcept {
a %= m;
lint res(1);
while (b) {
if (b & 1) {
res *= a;
res %= m;
}
a *= a;
a %= m;
b >>= 1;
}
return res;
}
template <class T>
constexpr void printArray(const std::vector<T>& vec, char split = ' ') {
rep(i, vec.size()) {
std::cout << vec[i];
std::cout << (i == (int)vec.size() - 1 ? '\n' : split);
}
}
template <class InputIter>
constexpr void printArray(InputIter l, InputIter r, char split = ' ') {
auto rprev = std::prev(r);
for (auto i = l; i != r; i++) {
std::cout << *i;
std::cout << (i == rprev ? '\n' : split);
}
}
LP extGcd(lint a, lint b) noexcept {
if (b == 0) return {1, 0};
LP s = extGcd(b, a % b);
std::swap(s.first, s.second);
s.second -= a / b * s.first;
return s;
}
LP ChineseRem(const lint& b1, const lint& m1, const lint& b2,
const lint& m2) noexcept {
auto p = extGcd(m1, m2);
lint g = gcd(m1, m2), l = m1 / g * m2;
lint tmp = (b2 - b1) / g * p.first % (m2 / g);
lint r = (b1 + m1 * tmp + l) % l;
return {r, l};
}
int LCS(const std::string& a, const std::string& b) {
auto dp = make_vec<int>(a.size() + 1, b.size() + 1);
rep(i, a.size()) {
rep(j, b.size()) {
chmax(dp[i + 1][j], dp[i][j]);
chmax(dp[i][j + 1], dp[i][j]);
if (a[i] == b[j]) chmax(dp[i + 1][j + 1], dp[i][j] + 1);
}
chmax(dp[i + 1][b.size()], dp[i][b.size()]);
}
rep(j, b.size()) chmax(dp[a.size()][j + 1], dp[a.size()][j]);
return dp[a.size()][b.size()];
}
template <class T, std::enable_if_t<std::is_convertible<int, T>::value,
std::nullptr_t> = nullptr>
void compress(std::vector<T>& vec) {
auto tmp = vec;
std::sort(all(tmp));
tmp.erase(std::unique(all(tmp)), tmp.end());
for (T& i : vec) i = std::lower_bound(all(tmp), i) - tmp.begin();
}
template <class T>
void compress(T* l, T* r) {
std::vector<T> tmp(l, r);
std::sort(all(tmp));
tmp.erase(std::unique(all(tmp)), tmp.end());
for (auto i = l; i < r; i++) {
*i = std::lower_bound(all(tmp), *i) - tmp.begin();
}
}
template <class InputIter>
void compress(InputIter l, InputIter r) {
std::vector<typename InputIter::value_type> tmp(l, r);
std::sort(all(tmp));
tmp.erase(std::unique(all(tmp)), tmp.end());
for (auto i = l; i < r; i++) {
*i = std::lower_bound(all(tmp), *i) - tmp.begin();
}
}
#line 3 "paint.cpp"
int minimumInstructions(int N, int M, int K, std::vector<int> C,
std::vector<int> A, std::vector<std::vector<int>> B) {
std::vector<std::vector<int>> empl(K);
rep(i, M) rep(j, A[i]) empl[B[i][j]].emplace_back(i);
std::vector<std::vector<int>> vec(M);
rep(i, N) {
for (int j : empl[C[i]]) {
int x = j - i;
if (x < 0)
x = -(-x % M) + M;
else
x %= M;
if (x == M) x = 0;
if (vec[x].empty() || vec[x].back() != i) vec[x].emplace_back(i);
}
}
std::vector<int> trans(N);
rep(i, M) {
rep(j, int(vec[i].size()) - M + 1) {
if (vec[i][j + M - 1] - vec[i][j] == M - 1) trans[vec[i][j]] = true;
}
}
std::vector<int> ans(N + 1, INF);
std::deque<int> deq;
deq.push_back(0);
ans[0] = 0;
while (!deq.empty()) {
int node = deq.front();
deq.pop_front();
if (node == N) return ans[N];
if (node && ans[node - 1] == INF) {
ans[node - 1] = ans[node];
deq.push_front(node - 1);
}
if (trans[node] && ans[node + M] == INF) {
ans[node + M] = ans[node] + 1;
deq.push_back(node + M);
}
}
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
1 ms |
204 KB |
Output is correct |
13 |
Correct |
2 ms |
2636 KB |
Output is correct |
14 |
Correct |
2 ms |
2636 KB |
Output is correct |
15 |
Correct |
2 ms |
2600 KB |
Output is correct |
16 |
Correct |
3 ms |
2636 KB |
Output is correct |
17 |
Correct |
2 ms |
2636 KB |
Output is correct |
18 |
Correct |
2 ms |
2636 KB |
Output is correct |
19 |
Correct |
3 ms |
2636 KB |
Output is correct |
20 |
Correct |
3 ms |
2636 KB |
Output is correct |
21 |
Correct |
2 ms |
2636 KB |
Output is correct |
22 |
Correct |
25 ms |
6604 KB |
Output is correct |
23 |
Correct |
23 ms |
6596 KB |
Output is correct |
24 |
Correct |
24 ms |
6604 KB |
Output is correct |
25 |
Correct |
3 ms |
664 KB |
Output is correct |
26 |
Correct |
3 ms |
716 KB |
Output is correct |
27 |
Correct |
3 ms |
716 KB |
Output is correct |
28 |
Correct |
3 ms |
716 KB |
Output is correct |
29 |
Correct |
3 ms |
716 KB |
Output is correct |
30 |
Correct |
5 ms |
716 KB |
Output is correct |
31 |
Correct |
12 ms |
4060 KB |
Output is correct |
32 |
Correct |
15 ms |
4056 KB |
Output is correct |
33 |
Correct |
12 ms |
4132 KB |
Output is correct |
34 |
Correct |
11 ms |
4064 KB |
Output is correct |
35 |
Correct |
11 ms |
4144 KB |
Output is correct |
36 |
Correct |
11 ms |
4088 KB |
Output is correct |
37 |
Correct |
29 ms |
7316 KB |
Output is correct |
38 |
Correct |
30 ms |
7288 KB |
Output is correct |
39 |
Correct |
30 ms |
7372 KB |
Output is correct |
40 |
Correct |
11 ms |
2244 KB |
Output is correct |
41 |
Correct |
7 ms |
1608 KB |
Output is correct |
42 |
Correct |
13 ms |
2504 KB |
Output is correct |
43 |
Correct |
9 ms |
1864 KB |
Output is correct |
44 |
Correct |
11 ms |
1680 KB |
Output is correct |
45 |
Correct |
12 ms |
2616 KB |
Output is correct |
46 |
Correct |
50 ms |
14344 KB |
Output is correct |
47 |
Correct |
33 ms |
8876 KB |
Output is correct |
48 |
Correct |
36 ms |
11828 KB |
Output is correct |
49 |
Correct |
52 ms |
12516 KB |
Output is correct |
50 |
Correct |
57 ms |
12172 KB |
Output is correct |
51 |
Correct |
43 ms |
9028 KB |
Output is correct |
52 |
Correct |
12 ms |
2476 KB |
Output is correct |
53 |
Correct |
12 ms |
2428 KB |
Output is correct |
54 |
Correct |
14 ms |
2416 KB |
Output is correct |
55 |
Correct |
13 ms |
2608 KB |
Output is correct |
56 |
Correct |
13 ms |
2448 KB |
Output is correct |
57 |
Correct |
13 ms |
2620 KB |
Output is correct |
58 |
Correct |
56 ms |
15144 KB |
Output is correct |
59 |
Correct |
71 ms |
15160 KB |
Output is correct |
60 |
Correct |
72 ms |
15164 KB |
Output is correct |
61 |
Correct |
66 ms |
15292 KB |
Output is correct |
62 |
Correct |
67 ms |
15236 KB |
Output is correct |
63 |
Correct |
57 ms |
15116 KB |
Output is correct |
64 |
Correct |
82 ms |
14900 KB |
Output is correct |
65 |
Correct |
83 ms |
14928 KB |
Output is correct |
66 |
Correct |
77 ms |
14912 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
1 ms |
204 KB |
Output is correct |
13 |
Correct |
2 ms |
2636 KB |
Output is correct |
14 |
Correct |
2 ms |
2636 KB |
Output is correct |
15 |
Correct |
2 ms |
2600 KB |
Output is correct |
16 |
Correct |
3 ms |
2636 KB |
Output is correct |
17 |
Correct |
2 ms |
2636 KB |
Output is correct |
18 |
Correct |
2 ms |
2636 KB |
Output is correct |
19 |
Correct |
3 ms |
2636 KB |
Output is correct |
20 |
Correct |
3 ms |
2636 KB |
Output is correct |
21 |
Correct |
2 ms |
2636 KB |
Output is correct |
22 |
Correct |
1 ms |
296 KB |
Output is correct |
23 |
Correct |
1 ms |
204 KB |
Output is correct |
24 |
Correct |
1 ms |
204 KB |
Output is correct |
25 |
Correct |
1 ms |
204 KB |
Output is correct |
26 |
Correct |
1 ms |
204 KB |
Output is correct |
27 |
Correct |
1 ms |
204 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
1 ms |
332 KB |
Output is correct |
30 |
Correct |
1 ms |
300 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
2 ms |
2252 KB |
Output is correct |
34 |
Correct |
2 ms |
1740 KB |
Output is correct |
35 |
Correct |
2 ms |
1612 KB |
Output is correct |
36 |
Correct |
2 ms |
2636 KB |
Output is correct |
37 |
Correct |
2 ms |
2124 KB |
Output is correct |
38 |
Correct |
2 ms |
2380 KB |
Output is correct |
39 |
Correct |
1 ms |
204 KB |
Output is correct |
40 |
Correct |
2 ms |
2124 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
2 ms |
2472 KB |
Output is correct |
43 |
Correct |
2 ms |
2380 KB |
Output is correct |
44 |
Correct |
1 ms |
204 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
1 ms |
332 KB |
Output is correct |
47 |
Correct |
1 ms |
292 KB |
Output is correct |
48 |
Correct |
1 ms |
332 KB |
Output is correct |
49 |
Correct |
1 ms |
332 KB |
Output is correct |
50 |
Correct |
2 ms |
2636 KB |
Output is correct |
51 |
Correct |
2 ms |
2636 KB |
Output is correct |
52 |
Correct |
2 ms |
2636 KB |
Output is correct |
53 |
Correct |
2 ms |
2636 KB |
Output is correct |
54 |
Correct |
3 ms |
2636 KB |
Output is correct |
55 |
Correct |
3 ms |
2636 KB |
Output is correct |
56 |
Correct |
2 ms |
2636 KB |
Output is correct |
57 |
Correct |
1 ms |
332 KB |
Output is correct |
58 |
Correct |
2 ms |
2604 KB |
Output is correct |
59 |
Correct |
1 ms |
332 KB |
Output is correct |
60 |
Correct |
2 ms |
2636 KB |
Output is correct |
61 |
Correct |
1 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
296 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
1 ms |
204 KB |
Output is correct |
13 |
Correct |
1 ms |
204 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
2 ms |
2636 KB |
Output is correct |
16 |
Correct |
2 ms |
2636 KB |
Output is correct |
17 |
Correct |
2 ms |
2600 KB |
Output is correct |
18 |
Correct |
3 ms |
2636 KB |
Output is correct |
19 |
Correct |
2 ms |
2636 KB |
Output is correct |
20 |
Correct |
2 ms |
2636 KB |
Output is correct |
21 |
Correct |
3 ms |
2636 KB |
Output is correct |
22 |
Correct |
3 ms |
2636 KB |
Output is correct |
23 |
Correct |
2 ms |
2636 KB |
Output is correct |
24 |
Correct |
25 ms |
6604 KB |
Output is correct |
25 |
Correct |
23 ms |
6596 KB |
Output is correct |
26 |
Correct |
24 ms |
6604 KB |
Output is correct |
27 |
Correct |
1 ms |
204 KB |
Output is correct |
28 |
Correct |
1 ms |
204 KB |
Output is correct |
29 |
Correct |
1 ms |
204 KB |
Output is correct |
30 |
Correct |
1 ms |
204 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
300 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
1 ms |
332 KB |
Output is correct |
36 |
Correct |
2 ms |
2252 KB |
Output is correct |
37 |
Correct |
2 ms |
1740 KB |
Output is correct |
38 |
Correct |
2 ms |
1612 KB |
Output is correct |
39 |
Correct |
2 ms |
2636 KB |
Output is correct |
40 |
Correct |
2 ms |
2124 KB |
Output is correct |
41 |
Correct |
2 ms |
2380 KB |
Output is correct |
42 |
Correct |
1 ms |
204 KB |
Output is correct |
43 |
Correct |
2 ms |
2124 KB |
Output is correct |
44 |
Correct |
1 ms |
332 KB |
Output is correct |
45 |
Correct |
2 ms |
2472 KB |
Output is correct |
46 |
Correct |
2 ms |
2380 KB |
Output is correct |
47 |
Correct |
1 ms |
204 KB |
Output is correct |
48 |
Correct |
1 ms |
332 KB |
Output is correct |
49 |
Correct |
1 ms |
332 KB |
Output is correct |
50 |
Correct |
1 ms |
292 KB |
Output is correct |
51 |
Correct |
1 ms |
332 KB |
Output is correct |
52 |
Correct |
1 ms |
332 KB |
Output is correct |
53 |
Correct |
2 ms |
2636 KB |
Output is correct |
54 |
Correct |
2 ms |
2636 KB |
Output is correct |
55 |
Correct |
2 ms |
2636 KB |
Output is correct |
56 |
Correct |
2 ms |
2636 KB |
Output is correct |
57 |
Correct |
3 ms |
2636 KB |
Output is correct |
58 |
Correct |
3 ms |
2636 KB |
Output is correct |
59 |
Correct |
2 ms |
2636 KB |
Output is correct |
60 |
Correct |
1 ms |
332 KB |
Output is correct |
61 |
Correct |
2 ms |
2604 KB |
Output is correct |
62 |
Correct |
1 ms |
332 KB |
Output is correct |
63 |
Correct |
2 ms |
2636 KB |
Output is correct |
64 |
Correct |
1 ms |
332 KB |
Output is correct |
65 |
Correct |
2 ms |
460 KB |
Output is correct |
66 |
Correct |
1 ms |
332 KB |
Output is correct |
67 |
Correct |
2 ms |
552 KB |
Output is correct |
68 |
Correct |
2 ms |
460 KB |
Output is correct |
69 |
Correct |
2 ms |
460 KB |
Output is correct |
70 |
Correct |
4 ms |
2508 KB |
Output is correct |
71 |
Correct |
5 ms |
2220 KB |
Output is correct |
72 |
Correct |
4 ms |
1928 KB |
Output is correct |
73 |
Correct |
3 ms |
2124 KB |
Output is correct |
74 |
Correct |
4 ms |
2440 KB |
Output is correct |
75 |
Correct |
4 ms |
2764 KB |
Output is correct |
76 |
Correct |
23 ms |
4680 KB |
Output is correct |
77 |
Correct |
23 ms |
5504 KB |
Output is correct |
78 |
Correct |
31 ms |
6212 KB |
Output is correct |
79 |
Correct |
3 ms |
716 KB |
Output is correct |
80 |
Correct |
3 ms |
716 KB |
Output is correct |
81 |
Correct |
3 ms |
664 KB |
Output is correct |
82 |
Correct |
3 ms |
716 KB |
Output is correct |
83 |
Correct |
3 ms |
716 KB |
Output is correct |
84 |
Correct |
4 ms |
2980 KB |
Output is correct |
85 |
Correct |
6 ms |
3020 KB |
Output is correct |
86 |
Correct |
5 ms |
3020 KB |
Output is correct |
87 |
Correct |
5 ms |
2996 KB |
Output is correct |
88 |
Correct |
6 ms |
3020 KB |
Output is correct |
89 |
Correct |
6 ms |
3020 KB |
Output is correct |
90 |
Correct |
34 ms |
6636 KB |
Output is correct |
91 |
Correct |
33 ms |
6532 KB |
Output is correct |
92 |
Correct |
37 ms |
6768 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
296 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
1 ms |
204 KB |
Output is correct |
13 |
Correct |
1 ms |
204 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
2 ms |
2636 KB |
Output is correct |
16 |
Correct |
2 ms |
2636 KB |
Output is correct |
17 |
Correct |
2 ms |
2600 KB |
Output is correct |
18 |
Correct |
3 ms |
2636 KB |
Output is correct |
19 |
Correct |
2 ms |
2636 KB |
Output is correct |
20 |
Correct |
2 ms |
2636 KB |
Output is correct |
21 |
Correct |
3 ms |
2636 KB |
Output is correct |
22 |
Correct |
3 ms |
2636 KB |
Output is correct |
23 |
Correct |
2 ms |
2636 KB |
Output is correct |
24 |
Correct |
25 ms |
6604 KB |
Output is correct |
25 |
Correct |
23 ms |
6596 KB |
Output is correct |
26 |
Correct |
24 ms |
6604 KB |
Output is correct |
27 |
Correct |
3 ms |
664 KB |
Output is correct |
28 |
Correct |
3 ms |
716 KB |
Output is correct |
29 |
Correct |
3 ms |
716 KB |
Output is correct |
30 |
Correct |
3 ms |
716 KB |
Output is correct |
31 |
Correct |
3 ms |
716 KB |
Output is correct |
32 |
Correct |
5 ms |
716 KB |
Output is correct |
33 |
Correct |
12 ms |
4060 KB |
Output is correct |
34 |
Correct |
15 ms |
4056 KB |
Output is correct |
35 |
Correct |
12 ms |
4132 KB |
Output is correct |
36 |
Correct |
11 ms |
4064 KB |
Output is correct |
37 |
Correct |
11 ms |
4144 KB |
Output is correct |
38 |
Correct |
11 ms |
4088 KB |
Output is correct |
39 |
Correct |
29 ms |
7316 KB |
Output is correct |
40 |
Correct |
30 ms |
7288 KB |
Output is correct |
41 |
Correct |
30 ms |
7372 KB |
Output is correct |
42 |
Correct |
1 ms |
204 KB |
Output is correct |
43 |
Correct |
1 ms |
204 KB |
Output is correct |
44 |
Correct |
1 ms |
204 KB |
Output is correct |
45 |
Correct |
1 ms |
204 KB |
Output is correct |
46 |
Correct |
1 ms |
332 KB |
Output is correct |
47 |
Correct |
1 ms |
332 KB |
Output is correct |
48 |
Correct |
1 ms |
300 KB |
Output is correct |
49 |
Correct |
1 ms |
332 KB |
Output is correct |
50 |
Correct |
1 ms |
332 KB |
Output is correct |
51 |
Correct |
2 ms |
2252 KB |
Output is correct |
52 |
Correct |
2 ms |
1740 KB |
Output is correct |
53 |
Correct |
2 ms |
1612 KB |
Output is correct |
54 |
Correct |
2 ms |
2636 KB |
Output is correct |
55 |
Correct |
2 ms |
2124 KB |
Output is correct |
56 |
Correct |
2 ms |
2380 KB |
Output is correct |
57 |
Correct |
1 ms |
204 KB |
Output is correct |
58 |
Correct |
2 ms |
2124 KB |
Output is correct |
59 |
Correct |
1 ms |
332 KB |
Output is correct |
60 |
Correct |
2 ms |
2472 KB |
Output is correct |
61 |
Correct |
2 ms |
2380 KB |
Output is correct |
62 |
Correct |
1 ms |
204 KB |
Output is correct |
63 |
Correct |
1 ms |
332 KB |
Output is correct |
64 |
Correct |
1 ms |
332 KB |
Output is correct |
65 |
Correct |
1 ms |
292 KB |
Output is correct |
66 |
Correct |
1 ms |
332 KB |
Output is correct |
67 |
Correct |
1 ms |
332 KB |
Output is correct |
68 |
Correct |
2 ms |
2636 KB |
Output is correct |
69 |
Correct |
2 ms |
2636 KB |
Output is correct |
70 |
Correct |
2 ms |
2636 KB |
Output is correct |
71 |
Correct |
2 ms |
2636 KB |
Output is correct |
72 |
Correct |
3 ms |
2636 KB |
Output is correct |
73 |
Correct |
3 ms |
2636 KB |
Output is correct |
74 |
Correct |
2 ms |
2636 KB |
Output is correct |
75 |
Correct |
1 ms |
332 KB |
Output is correct |
76 |
Correct |
2 ms |
2604 KB |
Output is correct |
77 |
Correct |
1 ms |
332 KB |
Output is correct |
78 |
Correct |
2 ms |
2636 KB |
Output is correct |
79 |
Correct |
1 ms |
332 KB |
Output is correct |
80 |
Correct |
2 ms |
460 KB |
Output is correct |
81 |
Correct |
1 ms |
332 KB |
Output is correct |
82 |
Correct |
2 ms |
552 KB |
Output is correct |
83 |
Correct |
2 ms |
460 KB |
Output is correct |
84 |
Correct |
2 ms |
460 KB |
Output is correct |
85 |
Correct |
4 ms |
2508 KB |
Output is correct |
86 |
Correct |
5 ms |
2220 KB |
Output is correct |
87 |
Correct |
4 ms |
1928 KB |
Output is correct |
88 |
Correct |
3 ms |
2124 KB |
Output is correct |
89 |
Correct |
4 ms |
2440 KB |
Output is correct |
90 |
Correct |
4 ms |
2764 KB |
Output is correct |
91 |
Correct |
23 ms |
4680 KB |
Output is correct |
92 |
Correct |
23 ms |
5504 KB |
Output is correct |
93 |
Correct |
31 ms |
6212 KB |
Output is correct |
94 |
Correct |
3 ms |
716 KB |
Output is correct |
95 |
Correct |
3 ms |
716 KB |
Output is correct |
96 |
Correct |
3 ms |
664 KB |
Output is correct |
97 |
Correct |
3 ms |
716 KB |
Output is correct |
98 |
Correct |
3 ms |
716 KB |
Output is correct |
99 |
Correct |
4 ms |
2980 KB |
Output is correct |
100 |
Correct |
6 ms |
3020 KB |
Output is correct |
101 |
Correct |
5 ms |
3020 KB |
Output is correct |
102 |
Correct |
5 ms |
2996 KB |
Output is correct |
103 |
Correct |
6 ms |
3020 KB |
Output is correct |
104 |
Correct |
6 ms |
3020 KB |
Output is correct |
105 |
Correct |
34 ms |
6636 KB |
Output is correct |
106 |
Correct |
33 ms |
6532 KB |
Output is correct |
107 |
Correct |
37 ms |
6768 KB |
Output is correct |
108 |
Correct |
4 ms |
844 KB |
Output is correct |
109 |
Correct |
164 ms |
39668 KB |
Output is correct |
110 |
Correct |
85 ms |
23264 KB |
Output is correct |
111 |
Correct |
63 ms |
21468 KB |
Output is correct |
112 |
Correct |
71 ms |
24056 KB |
Output is correct |
113 |
Correct |
48 ms |
16836 KB |
Output is correct |
114 |
Correct |
16 ms |
4260 KB |
Output is correct |
115 |
Correct |
15 ms |
4044 KB |
Output is correct |
116 |
Correct |
20 ms |
4532 KB |
Output is correct |
117 |
Correct |
15 ms |
3628 KB |
Output is correct |
118 |
Correct |
17 ms |
4220 KB |
Output is correct |
119 |
Correct |
19 ms |
4044 KB |
Output is correct |
120 |
Correct |
23 ms |
4580 KB |
Output is correct |
121 |
Correct |
7 ms |
1536 KB |
Output is correct |
122 |
Correct |
27 ms |
4684 KB |
Output is correct |
123 |
Correct |
6 ms |
1328 KB |
Output is correct |
124 |
Correct |
36 ms |
5812 KB |
Output is correct |
125 |
Correct |
9 ms |
1860 KB |
Output is correct |
126 |
Correct |
9 ms |
2780 KB |
Output is correct |
127 |
Correct |
11 ms |
3660 KB |
Output is correct |
128 |
Correct |
8 ms |
3148 KB |
Output is correct |
129 |
Correct |
9 ms |
2612 KB |
Output is correct |
130 |
Correct |
4 ms |
816 KB |
Output is correct |
131 |
Correct |
235 ms |
67140 KB |
Output is correct |
132 |
Correct |
147 ms |
49564 KB |
Output is correct |
133 |
Correct |
119 ms |
32960 KB |
Output is correct |
134 |
Correct |
107 ms |
33984 KB |
Output is correct |
135 |
Correct |
97 ms |
33992 KB |
Output is correct |
136 |
Correct |
22 ms |
4928 KB |
Output is correct |
137 |
Correct |
22 ms |
4928 KB |
Output is correct |
138 |
Correct |
22 ms |
4844 KB |
Output is correct |
139 |
Correct |
22 ms |
4924 KB |
Output is correct |
140 |
Correct |
22 ms |
4932 KB |
Output is correct |
141 |
Correct |
29 ms |
4820 KB |
Output is correct |
142 |
Correct |
41 ms |
7340 KB |
Output is correct |
143 |
Correct |
11 ms |
2228 KB |
Output is correct |
144 |
Correct |
40 ms |
7348 KB |
Output is correct |
145 |
Correct |
11 ms |
2220 KB |
Output is correct |
146 |
Correct |
42 ms |
7292 KB |
Output is correct |
147 |
Correct |
11 ms |
2192 KB |
Output is correct |
148 |
Correct |
13 ms |
4272 KB |
Output is correct |
149 |
Correct |
13 ms |
4176 KB |
Output is correct |
150 |
Correct |
13 ms |
4176 KB |
Output is correct |
151 |
Correct |
12 ms |
4044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
296 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
1 ms |
204 KB |
Output is correct |
13 |
Correct |
1 ms |
204 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
2 ms |
2636 KB |
Output is correct |
16 |
Correct |
2 ms |
2636 KB |
Output is correct |
17 |
Correct |
2 ms |
2600 KB |
Output is correct |
18 |
Correct |
3 ms |
2636 KB |
Output is correct |
19 |
Correct |
2 ms |
2636 KB |
Output is correct |
20 |
Correct |
2 ms |
2636 KB |
Output is correct |
21 |
Correct |
3 ms |
2636 KB |
Output is correct |
22 |
Correct |
3 ms |
2636 KB |
Output is correct |
23 |
Correct |
2 ms |
2636 KB |
Output is correct |
24 |
Correct |
25 ms |
6604 KB |
Output is correct |
25 |
Correct |
23 ms |
6596 KB |
Output is correct |
26 |
Correct |
24 ms |
6604 KB |
Output is correct |
27 |
Correct |
3 ms |
664 KB |
Output is correct |
28 |
Correct |
3 ms |
716 KB |
Output is correct |
29 |
Correct |
3 ms |
716 KB |
Output is correct |
30 |
Correct |
3 ms |
716 KB |
Output is correct |
31 |
Correct |
3 ms |
716 KB |
Output is correct |
32 |
Correct |
5 ms |
716 KB |
Output is correct |
33 |
Correct |
12 ms |
4060 KB |
Output is correct |
34 |
Correct |
15 ms |
4056 KB |
Output is correct |
35 |
Correct |
12 ms |
4132 KB |
Output is correct |
36 |
Correct |
11 ms |
4064 KB |
Output is correct |
37 |
Correct |
11 ms |
4144 KB |
Output is correct |
38 |
Correct |
11 ms |
4088 KB |
Output is correct |
39 |
Correct |
29 ms |
7316 KB |
Output is correct |
40 |
Correct |
30 ms |
7288 KB |
Output is correct |
41 |
Correct |
30 ms |
7372 KB |
Output is correct |
42 |
Correct |
11 ms |
2244 KB |
Output is correct |
43 |
Correct |
7 ms |
1608 KB |
Output is correct |
44 |
Correct |
13 ms |
2504 KB |
Output is correct |
45 |
Correct |
9 ms |
1864 KB |
Output is correct |
46 |
Correct |
11 ms |
1680 KB |
Output is correct |
47 |
Correct |
12 ms |
2616 KB |
Output is correct |
48 |
Correct |
50 ms |
14344 KB |
Output is correct |
49 |
Correct |
33 ms |
8876 KB |
Output is correct |
50 |
Correct |
36 ms |
11828 KB |
Output is correct |
51 |
Correct |
52 ms |
12516 KB |
Output is correct |
52 |
Correct |
57 ms |
12172 KB |
Output is correct |
53 |
Correct |
43 ms |
9028 KB |
Output is correct |
54 |
Correct |
12 ms |
2476 KB |
Output is correct |
55 |
Correct |
12 ms |
2428 KB |
Output is correct |
56 |
Correct |
14 ms |
2416 KB |
Output is correct |
57 |
Correct |
13 ms |
2608 KB |
Output is correct |
58 |
Correct |
13 ms |
2448 KB |
Output is correct |
59 |
Correct |
13 ms |
2620 KB |
Output is correct |
60 |
Correct |
56 ms |
15144 KB |
Output is correct |
61 |
Correct |
71 ms |
15160 KB |
Output is correct |
62 |
Correct |
72 ms |
15164 KB |
Output is correct |
63 |
Correct |
66 ms |
15292 KB |
Output is correct |
64 |
Correct |
67 ms |
15236 KB |
Output is correct |
65 |
Correct |
57 ms |
15116 KB |
Output is correct |
66 |
Correct |
82 ms |
14900 KB |
Output is correct |
67 |
Correct |
83 ms |
14928 KB |
Output is correct |
68 |
Correct |
77 ms |
14912 KB |
Output is correct |
69 |
Correct |
1 ms |
204 KB |
Output is correct |
70 |
Correct |
1 ms |
204 KB |
Output is correct |
71 |
Correct |
1 ms |
204 KB |
Output is correct |
72 |
Correct |
1 ms |
204 KB |
Output is correct |
73 |
Correct |
1 ms |
332 KB |
Output is correct |
74 |
Correct |
1 ms |
332 KB |
Output is correct |
75 |
Correct |
1 ms |
300 KB |
Output is correct |
76 |
Correct |
1 ms |
332 KB |
Output is correct |
77 |
Correct |
1 ms |
332 KB |
Output is correct |
78 |
Correct |
2 ms |
2252 KB |
Output is correct |
79 |
Correct |
2 ms |
1740 KB |
Output is correct |
80 |
Correct |
2 ms |
1612 KB |
Output is correct |
81 |
Correct |
2 ms |
2636 KB |
Output is correct |
82 |
Correct |
2 ms |
2124 KB |
Output is correct |
83 |
Correct |
2 ms |
2380 KB |
Output is correct |
84 |
Correct |
1 ms |
204 KB |
Output is correct |
85 |
Correct |
2 ms |
2124 KB |
Output is correct |
86 |
Correct |
1 ms |
332 KB |
Output is correct |
87 |
Correct |
2 ms |
2472 KB |
Output is correct |
88 |
Correct |
2 ms |
2380 KB |
Output is correct |
89 |
Correct |
1 ms |
204 KB |
Output is correct |
90 |
Correct |
1 ms |
332 KB |
Output is correct |
91 |
Correct |
1 ms |
332 KB |
Output is correct |
92 |
Correct |
1 ms |
292 KB |
Output is correct |
93 |
Correct |
1 ms |
332 KB |
Output is correct |
94 |
Correct |
1 ms |
332 KB |
Output is correct |
95 |
Correct |
2 ms |
2636 KB |
Output is correct |
96 |
Correct |
2 ms |
2636 KB |
Output is correct |
97 |
Correct |
2 ms |
2636 KB |
Output is correct |
98 |
Correct |
2 ms |
2636 KB |
Output is correct |
99 |
Correct |
3 ms |
2636 KB |
Output is correct |
100 |
Correct |
3 ms |
2636 KB |
Output is correct |
101 |
Correct |
2 ms |
2636 KB |
Output is correct |
102 |
Correct |
1 ms |
332 KB |
Output is correct |
103 |
Correct |
2 ms |
2604 KB |
Output is correct |
104 |
Correct |
1 ms |
332 KB |
Output is correct |
105 |
Correct |
2 ms |
2636 KB |
Output is correct |
106 |
Correct |
1 ms |
332 KB |
Output is correct |
107 |
Correct |
2 ms |
460 KB |
Output is correct |
108 |
Correct |
1 ms |
332 KB |
Output is correct |
109 |
Correct |
2 ms |
552 KB |
Output is correct |
110 |
Correct |
2 ms |
460 KB |
Output is correct |
111 |
Correct |
2 ms |
460 KB |
Output is correct |
112 |
Correct |
4 ms |
2508 KB |
Output is correct |
113 |
Correct |
5 ms |
2220 KB |
Output is correct |
114 |
Correct |
4 ms |
1928 KB |
Output is correct |
115 |
Correct |
3 ms |
2124 KB |
Output is correct |
116 |
Correct |
4 ms |
2440 KB |
Output is correct |
117 |
Correct |
4 ms |
2764 KB |
Output is correct |
118 |
Correct |
23 ms |
4680 KB |
Output is correct |
119 |
Correct |
23 ms |
5504 KB |
Output is correct |
120 |
Correct |
31 ms |
6212 KB |
Output is correct |
121 |
Correct |
3 ms |
716 KB |
Output is correct |
122 |
Correct |
3 ms |
716 KB |
Output is correct |
123 |
Correct |
3 ms |
664 KB |
Output is correct |
124 |
Correct |
3 ms |
716 KB |
Output is correct |
125 |
Correct |
3 ms |
716 KB |
Output is correct |
126 |
Correct |
4 ms |
2980 KB |
Output is correct |
127 |
Correct |
6 ms |
3020 KB |
Output is correct |
128 |
Correct |
5 ms |
3020 KB |
Output is correct |
129 |
Correct |
5 ms |
2996 KB |
Output is correct |
130 |
Correct |
6 ms |
3020 KB |
Output is correct |
131 |
Correct |
6 ms |
3020 KB |
Output is correct |
132 |
Correct |
34 ms |
6636 KB |
Output is correct |
133 |
Correct |
33 ms |
6532 KB |
Output is correct |
134 |
Correct |
37 ms |
6768 KB |
Output is correct |
135 |
Correct |
4 ms |
844 KB |
Output is correct |
136 |
Correct |
164 ms |
39668 KB |
Output is correct |
137 |
Correct |
85 ms |
23264 KB |
Output is correct |
138 |
Correct |
63 ms |
21468 KB |
Output is correct |
139 |
Correct |
71 ms |
24056 KB |
Output is correct |
140 |
Correct |
48 ms |
16836 KB |
Output is correct |
141 |
Correct |
16 ms |
4260 KB |
Output is correct |
142 |
Correct |
15 ms |
4044 KB |
Output is correct |
143 |
Correct |
20 ms |
4532 KB |
Output is correct |
144 |
Correct |
15 ms |
3628 KB |
Output is correct |
145 |
Correct |
17 ms |
4220 KB |
Output is correct |
146 |
Correct |
19 ms |
4044 KB |
Output is correct |
147 |
Correct |
23 ms |
4580 KB |
Output is correct |
148 |
Correct |
7 ms |
1536 KB |
Output is correct |
149 |
Correct |
27 ms |
4684 KB |
Output is correct |
150 |
Correct |
6 ms |
1328 KB |
Output is correct |
151 |
Correct |
36 ms |
5812 KB |
Output is correct |
152 |
Correct |
9 ms |
1860 KB |
Output is correct |
153 |
Correct |
9 ms |
2780 KB |
Output is correct |
154 |
Correct |
11 ms |
3660 KB |
Output is correct |
155 |
Correct |
8 ms |
3148 KB |
Output is correct |
156 |
Correct |
9 ms |
2612 KB |
Output is correct |
157 |
Correct |
4 ms |
816 KB |
Output is correct |
158 |
Correct |
235 ms |
67140 KB |
Output is correct |
159 |
Correct |
147 ms |
49564 KB |
Output is correct |
160 |
Correct |
119 ms |
32960 KB |
Output is correct |
161 |
Correct |
107 ms |
33984 KB |
Output is correct |
162 |
Correct |
97 ms |
33992 KB |
Output is correct |
163 |
Correct |
22 ms |
4928 KB |
Output is correct |
164 |
Correct |
22 ms |
4928 KB |
Output is correct |
165 |
Correct |
22 ms |
4844 KB |
Output is correct |
166 |
Correct |
22 ms |
4924 KB |
Output is correct |
167 |
Correct |
22 ms |
4932 KB |
Output is correct |
168 |
Correct |
29 ms |
4820 KB |
Output is correct |
169 |
Correct |
41 ms |
7340 KB |
Output is correct |
170 |
Correct |
11 ms |
2228 KB |
Output is correct |
171 |
Correct |
40 ms |
7348 KB |
Output is correct |
172 |
Correct |
11 ms |
2220 KB |
Output is correct |
173 |
Correct |
42 ms |
7292 KB |
Output is correct |
174 |
Correct |
11 ms |
2192 KB |
Output is correct |
175 |
Correct |
13 ms |
4272 KB |
Output is correct |
176 |
Correct |
13 ms |
4176 KB |
Output is correct |
177 |
Correct |
13 ms |
4176 KB |
Output is correct |
178 |
Correct |
12 ms |
4044 KB |
Output is correct |
179 |
Correct |
9 ms |
1992 KB |
Output is correct |
180 |
Correct |
482 ms |
107816 KB |
Output is correct |
181 |
Correct |
502 ms |
141228 KB |
Output is correct |
182 |
Correct |
658 ms |
175504 KB |
Output is correct |
183 |
Correct |
310 ms |
99404 KB |
Output is correct |
184 |
Correct |
251 ms |
73544 KB |
Output is correct |
185 |
Correct |
33 ms |
5916 KB |
Output is correct |
186 |
Correct |
32 ms |
8264 KB |
Output is correct |
187 |
Correct |
40 ms |
7140 KB |
Output is correct |
188 |
Correct |
41 ms |
7008 KB |
Output is correct |
189 |
Correct |
45 ms |
7332 KB |
Output is correct |
190 |
Correct |
53 ms |
8392 KB |
Output is correct |
191 |
Correct |
58 ms |
8436 KB |
Output is correct |
192 |
Correct |
35 ms |
5804 KB |
Output is correct |
193 |
Correct |
30 ms |
5480 KB |
Output is correct |
194 |
Correct |
16 ms |
2852 KB |
Output is correct |
195 |
Correct |
1239 ms |
261760 KB |
Output is correct |
196 |
Correct |
783 ms |
202224 KB |
Output is correct |
197 |
Correct |
668 ms |
190820 KB |
Output is correct |
198 |
Correct |
556 ms |
157156 KB |
Output is correct |
199 |
Correct |
518 ms |
160276 KB |
Output is correct |
200 |
Correct |
80 ms |
16108 KB |
Output is correct |
201 |
Correct |
88 ms |
16196 KB |
Output is correct |
202 |
Correct |
96 ms |
16140 KB |
Output is correct |
203 |
Correct |
78 ms |
16168 KB |
Output is correct |
204 |
Correct |
99 ms |
16176 KB |
Output is correct |
205 |
Correct |
90 ms |
16164 KB |
Output is correct |
206 |
Correct |
86 ms |
16008 KB |
Output is correct |
207 |
Correct |
72 ms |
15924 KB |
Output is correct |
208 |
Correct |
101 ms |
16028 KB |
Output is correct |
209 |
Correct |
75 ms |
15932 KB |
Output is correct |
210 |
Correct |
90 ms |
15956 KB |
Output is correct |
211 |
Correct |
70 ms |
15940 KB |
Output is correct |
212 |
Correct |
71 ms |
15812 KB |
Output is correct |
213 |
Correct |
78 ms |
12396 KB |
Output is correct |
214 |
Correct |
61 ms |
11692 KB |
Output is correct |
215 |
Correct |
61 ms |
11444 KB |
Output is correct |