Submission #1099986

# Submission time Handle Problem Language Result Execution time Memory
1099986 2024-10-12T10:32:28 Z marvinthang Brought Down the Grading Server? (CEOI23_balance) C++17
100 / 100
207 ms 42536 KB
/*************************************
*    author: marvinthang             *
*    created: 24.08.2023 17:47:06    *
*************************************/
 
#include <bits/stdc++.h>
 
using namespace std;
 
#define                  fi  first
#define                  se  second
#define                left  ___left
#define               right  ___right
#define                TIME  (1.0 * clock() / CLOCKS_PER_SEC)
#define             MASK(i)  (1LL << (i))
#define           BIT(x, i)  ((x) >> (i) & 1)
#define  __builtin_popcount  __builtin_popcountll
#define              ALL(v)  (v).begin(), (v).end()
#define           REP(i, n)  for (int i = 0, _n = (n); i < _n; ++i)
#define          REPD(i, n)  for (int i = (n); i-- > 0; )
#define        FOR(i, a, b)  for (int i = (a), _b = (b); i < _b; ++i) 
#define       FORD(i, b, a)  for (int i = (b), _a = (a); --i >= _a; ) 
#define       FORE(i, a, b)  for (int i = (a), _b = (b); i <= _b; ++i) 
#define      FORDE(i, b, a)  for (int i = (b), _a = (a); i >= _a; --i) 
#define        scan_op(...)  istream & operator >> (istream &in, __VA_ARGS__ &u)
#define       print_op(...)  ostream & operator << (ostream &out, const __VA_ARGS__ &u)
#define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
 
template <class U, class V> scan_op(pair <U, V>)  { return in >> u.first >> u.second; }
template <class T> scan_op(vector <T>)  { for (size_t i = 0; i < u.size(); ++i) in >> u[i]; return in; }
template <class U, class V> print_op(pair <U, V>)  { return out << '(' << u.first << ", " << u.second << ')'; }
template <size_t i, class T> ostream & print_tuple_utils(ostream &out, const T &tup) { if constexpr(i == tuple_size<T>::value) return out << ")";  else return print_tuple_utils<i + 1, T>(out << (i ? ", " : "(") << get<i>(tup), tup); }
template <class ...U> print_op(tuple<U...>) { return print_tuple_utils<0, tuple<U...>>(out, u); }
template <class Con, class = decltype(begin(declval<Con>()))> typename enable_if <!is_same<Con, string>::value, ostream&>::type operator << (ostream &out, const Con &con) { out << '{'; for (__typeof(con.begin()) it = con.begin(); it != con.end(); ++it) out << (it == con.begin() ? "" : ", ") << *it; return out << '}'; }
 
// end of template
 
const int MAX = 5e5 + 5;
 
int N, S, T;
vector <int> tasks[MAX];
vector <pair <int, int>> edges;
vector <int> adj[MAX];
int deg[MAX];
bool used[MAX];
 
void init(void) {
	cin >> N >> S >> T;
	REP(i, N) {
		tasks[i].resize(S);
		cin >> tasks[i];
	}
}
 
void euler_walk(int u) {
	list <int> ans;
	while (!adj[u].empty()) {
		int id = adj[u].back(); adj[u].pop_back();
		if (used[id]) continue;
		--deg[u];
		used[id] = true;
		if (u == edges[id].se) swap(edges[id].fi, edges[id].se);
		u = edges[id].se;
		--deg[u];
	}
	for (auto it: ans) euler_walk(it);
}
 
void add_edge(int u, int v) {
	adj[u].push_back(edges.size());
	adj[v].push_back(edges.size());
	++deg[u]; ++deg[v];
	edges.emplace_back(u, v);
}
 
void process(void) {
	for (int mid = S >> 1; mid >= 1; mid >>= 1) {
		for (int c = 0; c < S; c += mid << 1) {
			edges.clear();
			REP(r, N) REP(i, mid) add_edge(tasks[r][c + i], tasks[r][c + i + mid]);
			memset(used, false, edges.size() * sizeof(bool));
			for (auto [u, v]: edges) {
				if (deg[u] & 1) euler_walk(u);
				if (deg[v] & 1) euler_walk(v);
			}
			for (auto [u, v]: edges) {
				euler_walk(u);
				euler_walk(v);
			}
			int id = 0;
			REP(r, N) REP(i, mid) {
				if (tasks[r][c + i] == edges[id++].se) swap(tasks[r][c + i], tasks[r][c + i + mid]);
			}
		}
	}
	REP(i, N) {
		for (int x: tasks[i]) cout << x << ' ';
		cout << '\n';
	}
}
 
int main(void) {
	ios_base::sync_with_stdio(false); cin.tie(nullptr); // cout.tie(nullptr);
	file("balance");
	init();
	process();
	// cerr << "Time elapsed: " << TIME << " s.\n";
	return (0^0);
}

Compilation message

balance.cpp: In function 'int main()':
balance.cpp:27:57: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 | #define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
      |                                                  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
balance.cpp:104:2: note: in expansion of macro 'file'
  104 |  file("balance");
      |  ^~~~
balance.cpp:27:90: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 | #define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
      |                                                                                   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
balance.cpp:104:2: note: in expansion of macro 'file'
  104 |  file("balance");
      |  ^~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 26204 KB Correct
2 Correct 4 ms 26204 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 26204 KB Correct
2 Correct 4 ms 26204 KB Correct
3 Correct 4 ms 26040 KB Correct
4 Correct 4 ms 26204 KB Correct
5 Correct 4 ms 26208 KB Correct
6 Correct 4 ms 26204 KB Correct
7 Correct 4 ms 26204 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 48 ms 34760 KB Correct
2 Correct 43 ms 35012 KB Correct
3 Correct 41 ms 33240 KB Correct
4 Correct 30 ms 32128 KB Correct
5 Correct 40 ms 34108 KB Correct
6 Correct 46 ms 35244 KB Correct
7 Correct 47 ms 35528 KB Correct
8 Correct 43 ms 35784 KB Correct
9 Correct 40 ms 35536 KB Correct
10 Correct 48 ms 35784 KB Correct
11 Correct 35 ms 35536 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 48 ms 34760 KB Correct
2 Correct 43 ms 35012 KB Correct
3 Correct 41 ms 33240 KB Correct
4 Correct 30 ms 32128 KB Correct
5 Correct 40 ms 34108 KB Correct
6 Correct 46 ms 35244 KB Correct
7 Correct 47 ms 35528 KB Correct
8 Correct 43 ms 35784 KB Correct
9 Correct 40 ms 35536 KB Correct
10 Correct 48 ms 35784 KB Correct
11 Correct 35 ms 35536 KB Correct
12 Correct 46 ms 34760 KB Correct
13 Correct 59 ms 35012 KB Correct
14 Correct 39 ms 33224 KB Correct
15 Correct 28 ms 32360 KB Correct
16 Correct 40 ms 34104 KB Correct
17 Correct 46 ms 35384 KB Correct
18 Correct 49 ms 35500 KB Correct
19 Correct 44 ms 35636 KB Correct
20 Correct 42 ms 35700 KB Correct
21 Correct 35 ms 35712 KB Correct
22 Correct 66 ms 35580 KB Correct
23 Correct 48 ms 35404 KB Correct
24 Correct 30 ms 32196 KB Correct
25 Correct 59 ms 34328 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 26204 KB Correct
2 Correct 4 ms 26204 KB Correct
3 Correct 4 ms 26040 KB Correct
4 Correct 4 ms 26204 KB Correct
5 Correct 4 ms 26208 KB Correct
6 Correct 4 ms 26204 KB Correct
7 Correct 4 ms 26204 KB Correct
8 Correct 48 ms 34760 KB Correct
9 Correct 43 ms 35012 KB Correct
10 Correct 41 ms 33240 KB Correct
11 Correct 30 ms 32128 KB Correct
12 Correct 40 ms 34108 KB Correct
13 Correct 46 ms 35244 KB Correct
14 Correct 47 ms 35528 KB Correct
15 Correct 43 ms 35784 KB Correct
16 Correct 40 ms 35536 KB Correct
17 Correct 48 ms 35784 KB Correct
18 Correct 35 ms 35536 KB Correct
19 Correct 46 ms 34760 KB Correct
20 Correct 59 ms 35012 KB Correct
21 Correct 39 ms 33224 KB Correct
22 Correct 28 ms 32360 KB Correct
23 Correct 40 ms 34104 KB Correct
24 Correct 46 ms 35384 KB Correct
25 Correct 49 ms 35500 KB Correct
26 Correct 44 ms 35636 KB Correct
27 Correct 42 ms 35700 KB Correct
28 Correct 35 ms 35712 KB Correct
29 Correct 66 ms 35580 KB Correct
30 Correct 48 ms 35404 KB Correct
31 Correct 30 ms 32196 KB Correct
32 Correct 59 ms 34328 KB Correct
33 Correct 4 ms 26204 KB Correct
34 Correct 4 ms 26204 KB Correct
35 Correct 4 ms 26204 KB Correct
36 Correct 4 ms 26204 KB Correct
37 Correct 5 ms 26424 KB Correct
38 Correct 4 ms 26204 KB Correct
39 Correct 4 ms 26204 KB Correct
40 Correct 49 ms 34764 KB Correct
41 Correct 47 ms 34896 KB Correct
42 Correct 42 ms 33308 KB Correct
43 Correct 30 ms 32280 KB Correct
44 Correct 67 ms 34112 KB Correct
45 Correct 51 ms 35304 KB Correct
46 Correct 74 ms 35600 KB Correct
47 Correct 50 ms 35752 KB Correct
48 Correct 46 ms 35528 KB Correct
49 Correct 41 ms 35784 KB Correct
50 Correct 70 ms 35528 KB Correct
51 Correct 48 ms 35248 KB Correct
52 Correct 32 ms 32184 KB Correct
53 Correct 68 ms 34312 KB Correct
54 Correct 26 ms 31188 KB Correct
55 Correct 5 ms 26204 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 26204 KB Correct
2 Correct 7 ms 26460 KB Correct
3 Correct 7 ms 26424 KB Correct
4 Correct 6 ms 26460 KB Correct
5 Correct 8 ms 26548 KB Correct
6 Correct 7 ms 26460 KB Correct
7 Correct 9 ms 26460 KB Correct
8 Correct 7 ms 26460 KB Correct
9 Correct 8 ms 26472 KB Correct
10 Correct 7 ms 26460 KB Correct
11 Correct 6 ms 26460 KB Correct
12 Correct 6 ms 26568 KB Correct
13 Correct 6 ms 26460 KB Correct
14 Correct 7 ms 26460 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 26204 KB Correct
2 Correct 7 ms 26460 KB Correct
3 Correct 7 ms 26424 KB Correct
4 Correct 6 ms 26460 KB Correct
5 Correct 8 ms 26548 KB Correct
6 Correct 7 ms 26460 KB Correct
7 Correct 9 ms 26460 KB Correct
8 Correct 7 ms 26460 KB Correct
9 Correct 8 ms 26472 KB Correct
10 Correct 7 ms 26460 KB Correct
11 Correct 6 ms 26460 KB Correct
12 Correct 6 ms 26568 KB Correct
13 Correct 6 ms 26460 KB Correct
14 Correct 7 ms 26460 KB Correct
15 Correct 6 ms 26204 KB Correct
16 Correct 6 ms 26464 KB Correct
17 Correct 9 ms 26204 KB Correct
18 Correct 8 ms 26460 KB Correct
19 Correct 7 ms 26460 KB Correct
20 Correct 6 ms 26460 KB Correct
21 Correct 7 ms 26460 KB Correct
22 Correct 7 ms 26460 KB Correct
23 Correct 7 ms 26420 KB Correct
24 Correct 6 ms 26460 KB Correct
25 Correct 6 ms 26460 KB Correct
26 Correct 8 ms 26460 KB Correct
27 Correct 7 ms 26460 KB Correct
28 Correct 7 ms 26460 KB Correct
29 Correct 7 ms 26460 KB Correct
30 Correct 6 ms 26460 KB Correct
31 Correct 6 ms 26460 KB Correct
32 Correct 9 ms 26460 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 26204 KB Correct
2 Correct 7 ms 26460 KB Correct
3 Correct 7 ms 26424 KB Correct
4 Correct 6 ms 26460 KB Correct
5 Correct 8 ms 26548 KB Correct
6 Correct 7 ms 26460 KB Correct
7 Correct 9 ms 26460 KB Correct
8 Correct 7 ms 26460 KB Correct
9 Correct 8 ms 26472 KB Correct
10 Correct 7 ms 26460 KB Correct
11 Correct 6 ms 26460 KB Correct
12 Correct 6 ms 26568 KB Correct
13 Correct 6 ms 26460 KB Correct
14 Correct 7 ms 26460 KB Correct
15 Correct 6 ms 26204 KB Correct
16 Correct 6 ms 26464 KB Correct
17 Correct 9 ms 26204 KB Correct
18 Correct 8 ms 26460 KB Correct
19 Correct 7 ms 26460 KB Correct
20 Correct 6 ms 26460 KB Correct
21 Correct 7 ms 26460 KB Correct
22 Correct 7 ms 26460 KB Correct
23 Correct 7 ms 26420 KB Correct
24 Correct 6 ms 26460 KB Correct
25 Correct 6 ms 26460 KB Correct
26 Correct 8 ms 26460 KB Correct
27 Correct 7 ms 26460 KB Correct
28 Correct 7 ms 26460 KB Correct
29 Correct 7 ms 26460 KB Correct
30 Correct 6 ms 26460 KB Correct
31 Correct 6 ms 26460 KB Correct
32 Correct 9 ms 26460 KB Correct
33 Correct 5 ms 26204 KB Correct
34 Correct 6 ms 26300 KB Correct
35 Correct 8 ms 26204 KB Correct
36 Correct 7 ms 26460 KB Correct
37 Correct 6 ms 26432 KB Correct
38 Correct 6 ms 26460 KB Correct
39 Correct 6 ms 26340 KB Correct
40 Correct 9 ms 26460 KB Correct
41 Correct 6 ms 26460 KB Correct
42 Correct 6 ms 26536 KB Correct
43 Correct 6 ms 26476 KB Correct
44 Correct 8 ms 26716 KB Correct
45 Correct 8 ms 26460 KB Correct
46 Correct 6 ms 26460 KB Correct
47 Correct 6 ms 26460 KB Correct
48 Correct 8 ms 26544 KB Correct
49 Correct 6 ms 26460 KB Correct
50 Correct 6 ms 26480 KB Correct
51 Correct 4 ms 26212 KB Correct
52 Correct 5 ms 26204 KB Correct
53 Correct 6 ms 26212 KB Correct
54 Correct 4 ms 26204 KB Correct
55 Correct 4 ms 26204 KB Correct
56 Correct 5 ms 26204 KB Correct
57 Correct 5 ms 26204 KB Correct
58 Correct 7 ms 26716 KB Correct
59 Correct 8 ms 26460 KB Correct
60 Correct 8 ms 26460 KB Correct
61 Correct 8 ms 26460 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 48 ms 34760 KB Correct
2 Correct 43 ms 35012 KB Correct
3 Correct 41 ms 33240 KB Correct
4 Correct 30 ms 32128 KB Correct
5 Correct 40 ms 34108 KB Correct
6 Correct 46 ms 35244 KB Correct
7 Correct 47 ms 35528 KB Correct
8 Correct 43 ms 35784 KB Correct
9 Correct 40 ms 35536 KB Correct
10 Correct 48 ms 35784 KB Correct
11 Correct 35 ms 35536 KB Correct
12 Correct 6 ms 26204 KB Correct
13 Correct 7 ms 26460 KB Correct
14 Correct 7 ms 26424 KB Correct
15 Correct 6 ms 26460 KB Correct
16 Correct 8 ms 26548 KB Correct
17 Correct 7 ms 26460 KB Correct
18 Correct 9 ms 26460 KB Correct
19 Correct 7 ms 26460 KB Correct
20 Correct 8 ms 26472 KB Correct
21 Correct 7 ms 26460 KB Correct
22 Correct 6 ms 26460 KB Correct
23 Correct 6 ms 26568 KB Correct
24 Correct 6 ms 26460 KB Correct
25 Correct 7 ms 26460 KB Correct
26 Correct 48 ms 34728 KB Correct
27 Correct 45 ms 34824 KB Correct
28 Correct 44 ms 33172 KB Correct
29 Correct 47 ms 32240 KB Correct
30 Correct 46 ms 34168 KB Correct
31 Correct 53 ms 35452 KB Correct
32 Correct 57 ms 35544 KB Correct
33 Correct 48 ms 35784 KB Correct
34 Correct 48 ms 35528 KB Correct
35 Correct 49 ms 35744 KB Correct
36 Correct 41 ms 35528 KB Correct
37 Correct 6 ms 26204 KB Correct
38 Correct 7 ms 26460 KB Correct
39 Correct 8 ms 26204 KB Correct
40 Correct 7 ms 26456 KB Correct
41 Correct 7 ms 26460 KB Correct
42 Correct 7 ms 26552 KB Correct
43 Correct 7 ms 26460 KB Correct
44 Correct 6 ms 26436 KB Correct
45 Correct 9 ms 26460 KB Correct
46 Correct 9 ms 26460 KB Correct
47 Correct 6 ms 26460 KB Correct
48 Correct 9 ms 26460 KB Correct
49 Correct 7 ms 26636 KB Correct
50 Correct 8 ms 26460 KB Correct
51 Correct 197 ms 40116 KB Correct
52 Correct 153 ms 36248 KB Correct
53 Correct 36 ms 27744 KB Correct
54 Correct 55 ms 30768 KB Correct
55 Correct 152 ms 35012 KB Correct
56 Correct 143 ms 39616 KB Correct
57 Correct 156 ms 40432 KB Correct
58 Correct 187 ms 35076 KB Correct
59 Correct 157 ms 33472 KB Correct
60 Correct 126 ms 38592 KB Correct
61 Correct 150 ms 40160 KB Correct
62 Correct 72 ms 38824 KB Correct
63 Correct 74 ms 38892 KB Correct
64 Correct 82 ms 38932 KB Correct
65 Correct 73 ms 38860 KB Correct
66 Correct 75 ms 38848 KB Correct
67 Correct 64 ms 38840 KB Correct
68 Correct 97 ms 38820 KB Correct
69 Correct 102 ms 38984 KB Correct
70 Correct 106 ms 40128 KB Correct
71 Correct 89 ms 40128 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 48 ms 34760 KB Correct
2 Correct 43 ms 35012 KB Correct
3 Correct 41 ms 33240 KB Correct
4 Correct 30 ms 32128 KB Correct
5 Correct 40 ms 34108 KB Correct
6 Correct 46 ms 35244 KB Correct
7 Correct 47 ms 35528 KB Correct
8 Correct 43 ms 35784 KB Correct
9 Correct 40 ms 35536 KB Correct
10 Correct 48 ms 35784 KB Correct
11 Correct 35 ms 35536 KB Correct
12 Correct 46 ms 34760 KB Correct
13 Correct 59 ms 35012 KB Correct
14 Correct 39 ms 33224 KB Correct
15 Correct 28 ms 32360 KB Correct
16 Correct 40 ms 34104 KB Correct
17 Correct 46 ms 35384 KB Correct
18 Correct 49 ms 35500 KB Correct
19 Correct 44 ms 35636 KB Correct
20 Correct 42 ms 35700 KB Correct
21 Correct 35 ms 35712 KB Correct
22 Correct 66 ms 35580 KB Correct
23 Correct 48 ms 35404 KB Correct
24 Correct 30 ms 32196 KB Correct
25 Correct 59 ms 34328 KB Correct
26 Correct 6 ms 26204 KB Correct
27 Correct 7 ms 26460 KB Correct
28 Correct 7 ms 26424 KB Correct
29 Correct 6 ms 26460 KB Correct
30 Correct 8 ms 26548 KB Correct
31 Correct 7 ms 26460 KB Correct
32 Correct 9 ms 26460 KB Correct
33 Correct 7 ms 26460 KB Correct
34 Correct 8 ms 26472 KB Correct
35 Correct 7 ms 26460 KB Correct
36 Correct 6 ms 26460 KB Correct
37 Correct 6 ms 26568 KB Correct
38 Correct 6 ms 26460 KB Correct
39 Correct 7 ms 26460 KB Correct
40 Correct 6 ms 26204 KB Correct
41 Correct 6 ms 26464 KB Correct
42 Correct 9 ms 26204 KB Correct
43 Correct 8 ms 26460 KB Correct
44 Correct 7 ms 26460 KB Correct
45 Correct 6 ms 26460 KB Correct
46 Correct 7 ms 26460 KB Correct
47 Correct 7 ms 26460 KB Correct
48 Correct 7 ms 26420 KB Correct
49 Correct 6 ms 26460 KB Correct
50 Correct 6 ms 26460 KB Correct
51 Correct 8 ms 26460 KB Correct
52 Correct 7 ms 26460 KB Correct
53 Correct 7 ms 26460 KB Correct
54 Correct 7 ms 26460 KB Correct
55 Correct 6 ms 26460 KB Correct
56 Correct 6 ms 26460 KB Correct
57 Correct 9 ms 26460 KB Correct
58 Correct 48 ms 34728 KB Correct
59 Correct 45 ms 34824 KB Correct
60 Correct 44 ms 33172 KB Correct
61 Correct 47 ms 32240 KB Correct
62 Correct 46 ms 34168 KB Correct
63 Correct 53 ms 35452 KB Correct
64 Correct 57 ms 35544 KB Correct
65 Correct 48 ms 35784 KB Correct
66 Correct 48 ms 35528 KB Correct
67 Correct 49 ms 35744 KB Correct
68 Correct 41 ms 35528 KB Correct
69 Correct 6 ms 26204 KB Correct
70 Correct 7 ms 26460 KB Correct
71 Correct 8 ms 26204 KB Correct
72 Correct 7 ms 26456 KB Correct
73 Correct 7 ms 26460 KB Correct
74 Correct 7 ms 26552 KB Correct
75 Correct 7 ms 26460 KB Correct
76 Correct 6 ms 26436 KB Correct
77 Correct 9 ms 26460 KB Correct
78 Correct 9 ms 26460 KB Correct
79 Correct 6 ms 26460 KB Correct
80 Correct 9 ms 26460 KB Correct
81 Correct 7 ms 26636 KB Correct
82 Correct 8 ms 26460 KB Correct
83 Correct 197 ms 40116 KB Correct
84 Correct 153 ms 36248 KB Correct
85 Correct 36 ms 27744 KB Correct
86 Correct 55 ms 30768 KB Correct
87 Correct 152 ms 35012 KB Correct
88 Correct 143 ms 39616 KB Correct
89 Correct 156 ms 40432 KB Correct
90 Correct 187 ms 35076 KB Correct
91 Correct 157 ms 33472 KB Correct
92 Correct 126 ms 38592 KB Correct
93 Correct 150 ms 40160 KB Correct
94 Correct 72 ms 38824 KB Correct
95 Correct 74 ms 38892 KB Correct
96 Correct 82 ms 38932 KB Correct
97 Correct 73 ms 38860 KB Correct
98 Correct 75 ms 38848 KB Correct
99 Correct 64 ms 38840 KB Correct
100 Correct 97 ms 38820 KB Correct
101 Correct 102 ms 38984 KB Correct
102 Correct 106 ms 40128 KB Correct
103 Correct 89 ms 40128 KB Correct
104 Correct 47 ms 34764 KB Correct
105 Correct 52 ms 35272 KB Correct
106 Correct 45 ms 33224 KB Correct
107 Correct 46 ms 32284 KB Correct
108 Correct 59 ms 34136 KB Correct
109 Correct 49 ms 35388 KB Correct
110 Correct 65 ms 35524 KB Correct
111 Correct 48 ms 35784 KB Correct
112 Correct 57 ms 35724 KB Correct
113 Correct 60 ms 35564 KB Correct
114 Correct 67 ms 35644 KB Correct
115 Correct 5 ms 26204 KB Correct
116 Correct 6 ms 26420 KB Correct
117 Correct 6 ms 26224 KB Correct
118 Correct 6 ms 26460 KB Correct
119 Correct 5 ms 26460 KB Correct
120 Correct 6 ms 26460 KB Correct
121 Correct 8 ms 26544 KB Correct
122 Correct 7 ms 26432 KB Correct
123 Correct 8 ms 26460 KB Correct
124 Correct 7 ms 26428 KB Correct
125 Correct 5 ms 26508 KB Correct
126 Correct 6 ms 26716 KB Correct
127 Correct 9 ms 26808 KB Correct
128 Correct 7 ms 26576 KB Correct
129 Correct 177 ms 39984 KB Correct
130 Correct 201 ms 36288 KB Correct
131 Correct 33 ms 27860 KB Correct
132 Correct 50 ms 30760 KB Correct
133 Correct 143 ms 35112 KB Correct
134 Correct 145 ms 39660 KB Correct
135 Correct 197 ms 40548 KB Correct
136 Correct 183 ms 35068 KB Correct
137 Correct 120 ms 33516 KB Correct
138 Correct 139 ms 38596 KB Correct
139 Correct 175 ms 40240 KB Correct
140 Correct 70 ms 38976 KB Correct
141 Correct 66 ms 38848 KB Correct
142 Correct 68 ms 39208 KB Correct
143 Correct 81 ms 38760 KB Correct
144 Correct 95 ms 38836 KB Correct
145 Correct 68 ms 38848 KB Correct
146 Correct 67 ms 38828 KB Correct
147 Correct 69 ms 38880 KB Correct
148 Correct 86 ms 40192 KB Correct
149 Correct 98 ms 40176 KB Correct
150 Correct 80 ms 35304 KB Correct
151 Correct 32 ms 32208 KB Correct
152 Correct 53 ms 34192 KB Correct
153 Correct 7 ms 26460 KB Correct
154 Correct 9 ms 26460 KB Correct
155 Correct 9 ms 26460 KB Correct
156 Correct 10 ms 26460 KB Correct
157 Correct 181 ms 41168 KB Correct
158 Correct 175 ms 37328 KB Correct
159 Correct 28 ms 28364 KB Correct
160 Correct 188 ms 41408 KB Correct
161 Correct 153 ms 41296 KB Correct
162 Correct 150 ms 36288 KB Correct
163 Correct 153 ms 41664 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 26204 KB Correct
2 Correct 4 ms 26204 KB Correct
3 Correct 5 ms 26204 KB Correct
4 Correct 4 ms 26204 KB Correct
5 Correct 4 ms 26040 KB Correct
6 Correct 4 ms 26204 KB Correct
7 Correct 4 ms 26208 KB Correct
8 Correct 4 ms 26204 KB Correct
9 Correct 4 ms 26204 KB Correct
10 Correct 48 ms 34760 KB Correct
11 Correct 43 ms 35012 KB Correct
12 Correct 41 ms 33240 KB Correct
13 Correct 30 ms 32128 KB Correct
14 Correct 40 ms 34108 KB Correct
15 Correct 46 ms 35244 KB Correct
16 Correct 47 ms 35528 KB Correct
17 Correct 43 ms 35784 KB Correct
18 Correct 40 ms 35536 KB Correct
19 Correct 48 ms 35784 KB Correct
20 Correct 35 ms 35536 KB Correct
21 Correct 46 ms 34760 KB Correct
22 Correct 59 ms 35012 KB Correct
23 Correct 39 ms 33224 KB Correct
24 Correct 28 ms 32360 KB Correct
25 Correct 40 ms 34104 KB Correct
26 Correct 46 ms 35384 KB Correct
27 Correct 49 ms 35500 KB Correct
28 Correct 44 ms 35636 KB Correct
29 Correct 42 ms 35700 KB Correct
30 Correct 35 ms 35712 KB Correct
31 Correct 66 ms 35580 KB Correct
32 Correct 48 ms 35404 KB Correct
33 Correct 30 ms 32196 KB Correct
34 Correct 59 ms 34328 KB Correct
35 Correct 4 ms 26204 KB Correct
36 Correct 4 ms 26204 KB Correct
37 Correct 4 ms 26204 KB Correct
38 Correct 4 ms 26204 KB Correct
39 Correct 5 ms 26424 KB Correct
40 Correct 4 ms 26204 KB Correct
41 Correct 4 ms 26204 KB Correct
42 Correct 49 ms 34764 KB Correct
43 Correct 47 ms 34896 KB Correct
44 Correct 42 ms 33308 KB Correct
45 Correct 30 ms 32280 KB Correct
46 Correct 67 ms 34112 KB Correct
47 Correct 51 ms 35304 KB Correct
48 Correct 74 ms 35600 KB Correct
49 Correct 50 ms 35752 KB Correct
50 Correct 46 ms 35528 KB Correct
51 Correct 41 ms 35784 KB Correct
52 Correct 70 ms 35528 KB Correct
53 Correct 48 ms 35248 KB Correct
54 Correct 32 ms 32184 KB Correct
55 Correct 68 ms 34312 KB Correct
56 Correct 26 ms 31188 KB Correct
57 Correct 5 ms 26204 KB Correct
58 Correct 6 ms 26204 KB Correct
59 Correct 7 ms 26460 KB Correct
60 Correct 7 ms 26424 KB Correct
61 Correct 6 ms 26460 KB Correct
62 Correct 8 ms 26548 KB Correct
63 Correct 7 ms 26460 KB Correct
64 Correct 9 ms 26460 KB Correct
65 Correct 7 ms 26460 KB Correct
66 Correct 8 ms 26472 KB Correct
67 Correct 7 ms 26460 KB Correct
68 Correct 6 ms 26460 KB Correct
69 Correct 6 ms 26568 KB Correct
70 Correct 6 ms 26460 KB Correct
71 Correct 7 ms 26460 KB Correct
72 Correct 6 ms 26204 KB Correct
73 Correct 6 ms 26464 KB Correct
74 Correct 9 ms 26204 KB Correct
75 Correct 8 ms 26460 KB Correct
76 Correct 7 ms 26460 KB Correct
77 Correct 6 ms 26460 KB Correct
78 Correct 7 ms 26460 KB Correct
79 Correct 7 ms 26460 KB Correct
80 Correct 7 ms 26420 KB Correct
81 Correct 6 ms 26460 KB Correct
82 Correct 6 ms 26460 KB Correct
83 Correct 8 ms 26460 KB Correct
84 Correct 7 ms 26460 KB Correct
85 Correct 7 ms 26460 KB Correct
86 Correct 7 ms 26460 KB Correct
87 Correct 6 ms 26460 KB Correct
88 Correct 6 ms 26460 KB Correct
89 Correct 9 ms 26460 KB Correct
90 Correct 5 ms 26204 KB Correct
91 Correct 6 ms 26300 KB Correct
92 Correct 8 ms 26204 KB Correct
93 Correct 7 ms 26460 KB Correct
94 Correct 6 ms 26432 KB Correct
95 Correct 6 ms 26460 KB Correct
96 Correct 6 ms 26340 KB Correct
97 Correct 9 ms 26460 KB Correct
98 Correct 6 ms 26460 KB Correct
99 Correct 6 ms 26536 KB Correct
100 Correct 6 ms 26476 KB Correct
101 Correct 8 ms 26716 KB Correct
102 Correct 8 ms 26460 KB Correct
103 Correct 6 ms 26460 KB Correct
104 Correct 6 ms 26460 KB Correct
105 Correct 8 ms 26544 KB Correct
106 Correct 6 ms 26460 KB Correct
107 Correct 6 ms 26480 KB Correct
108 Correct 4 ms 26212 KB Correct
109 Correct 5 ms 26204 KB Correct
110 Correct 6 ms 26212 KB Correct
111 Correct 4 ms 26204 KB Correct
112 Correct 4 ms 26204 KB Correct
113 Correct 5 ms 26204 KB Correct
114 Correct 5 ms 26204 KB Correct
115 Correct 7 ms 26716 KB Correct
116 Correct 8 ms 26460 KB Correct
117 Correct 8 ms 26460 KB Correct
118 Correct 8 ms 26460 KB Correct
119 Correct 48 ms 34728 KB Correct
120 Correct 45 ms 34824 KB Correct
121 Correct 44 ms 33172 KB Correct
122 Correct 47 ms 32240 KB Correct
123 Correct 46 ms 34168 KB Correct
124 Correct 53 ms 35452 KB Correct
125 Correct 57 ms 35544 KB Correct
126 Correct 48 ms 35784 KB Correct
127 Correct 48 ms 35528 KB Correct
128 Correct 49 ms 35744 KB Correct
129 Correct 41 ms 35528 KB Correct
130 Correct 6 ms 26204 KB Correct
131 Correct 7 ms 26460 KB Correct
132 Correct 8 ms 26204 KB Correct
133 Correct 7 ms 26456 KB Correct
134 Correct 7 ms 26460 KB Correct
135 Correct 7 ms 26552 KB Correct
136 Correct 7 ms 26460 KB Correct
137 Correct 6 ms 26436 KB Correct
138 Correct 9 ms 26460 KB Correct
139 Correct 9 ms 26460 KB Correct
140 Correct 6 ms 26460 KB Correct
141 Correct 9 ms 26460 KB Correct
142 Correct 7 ms 26636 KB Correct
143 Correct 8 ms 26460 KB Correct
144 Correct 197 ms 40116 KB Correct
145 Correct 153 ms 36248 KB Correct
146 Correct 36 ms 27744 KB Correct
147 Correct 55 ms 30768 KB Correct
148 Correct 152 ms 35012 KB Correct
149 Correct 143 ms 39616 KB Correct
150 Correct 156 ms 40432 KB Correct
151 Correct 187 ms 35076 KB Correct
152 Correct 157 ms 33472 KB Correct
153 Correct 126 ms 38592 KB Correct
154 Correct 150 ms 40160 KB Correct
155 Correct 72 ms 38824 KB Correct
156 Correct 74 ms 38892 KB Correct
157 Correct 82 ms 38932 KB Correct
158 Correct 73 ms 38860 KB Correct
159 Correct 75 ms 38848 KB Correct
160 Correct 64 ms 38840 KB Correct
161 Correct 97 ms 38820 KB Correct
162 Correct 102 ms 38984 KB Correct
163 Correct 106 ms 40128 KB Correct
164 Correct 89 ms 40128 KB Correct
165 Correct 47 ms 34764 KB Correct
166 Correct 52 ms 35272 KB Correct
167 Correct 45 ms 33224 KB Correct
168 Correct 46 ms 32284 KB Correct
169 Correct 59 ms 34136 KB Correct
170 Correct 49 ms 35388 KB Correct
171 Correct 65 ms 35524 KB Correct
172 Correct 48 ms 35784 KB Correct
173 Correct 57 ms 35724 KB Correct
174 Correct 60 ms 35564 KB Correct
175 Correct 67 ms 35644 KB Correct
176 Correct 5 ms 26204 KB Correct
177 Correct 6 ms 26420 KB Correct
178 Correct 6 ms 26224 KB Correct
179 Correct 6 ms 26460 KB Correct
180 Correct 5 ms 26460 KB Correct
181 Correct 6 ms 26460 KB Correct
182 Correct 8 ms 26544 KB Correct
183 Correct 7 ms 26432 KB Correct
184 Correct 8 ms 26460 KB Correct
185 Correct 7 ms 26428 KB Correct
186 Correct 5 ms 26508 KB Correct
187 Correct 6 ms 26716 KB Correct
188 Correct 9 ms 26808 KB Correct
189 Correct 7 ms 26576 KB Correct
190 Correct 177 ms 39984 KB Correct
191 Correct 201 ms 36288 KB Correct
192 Correct 33 ms 27860 KB Correct
193 Correct 50 ms 30760 KB Correct
194 Correct 143 ms 35112 KB Correct
195 Correct 145 ms 39660 KB Correct
196 Correct 197 ms 40548 KB Correct
197 Correct 183 ms 35068 KB Correct
198 Correct 120 ms 33516 KB Correct
199 Correct 139 ms 38596 KB Correct
200 Correct 175 ms 40240 KB Correct
201 Correct 70 ms 38976 KB Correct
202 Correct 66 ms 38848 KB Correct
203 Correct 68 ms 39208 KB Correct
204 Correct 81 ms 38760 KB Correct
205 Correct 95 ms 38836 KB Correct
206 Correct 68 ms 38848 KB Correct
207 Correct 67 ms 38828 KB Correct
208 Correct 69 ms 38880 KB Correct
209 Correct 86 ms 40192 KB Correct
210 Correct 98 ms 40176 KB Correct
211 Correct 80 ms 35304 KB Correct
212 Correct 32 ms 32208 KB Correct
213 Correct 53 ms 34192 KB Correct
214 Correct 7 ms 26460 KB Correct
215 Correct 9 ms 26460 KB Correct
216 Correct 9 ms 26460 KB Correct
217 Correct 10 ms 26460 KB Correct
218 Correct 181 ms 41168 KB Correct
219 Correct 175 ms 37328 KB Correct
220 Correct 28 ms 28364 KB Correct
221 Correct 188 ms 41408 KB Correct
222 Correct 153 ms 41296 KB Correct
223 Correct 150 ms 36288 KB Correct
224 Correct 153 ms 41664 KB Correct
225 Correct 49 ms 34556 KB Correct
226 Correct 44 ms 34792 KB Correct
227 Correct 46 ms 33224 KB Correct
228 Correct 49 ms 32584 KB Correct
229 Correct 54 ms 34112 KB Correct
230 Correct 46 ms 35308 KB Correct
231 Correct 69 ms 35504 KB Correct
232 Correct 53 ms 35704 KB Correct
233 Correct 53 ms 35500 KB Correct
234 Correct 62 ms 35780 KB Correct
235 Correct 71 ms 35636 KB Correct
236 Correct 5 ms 26204 KB Correct
237 Correct 6 ms 26460 KB Correct
238 Correct 7 ms 26420 KB Correct
239 Correct 7 ms 26460 KB Correct
240 Correct 10 ms 26460 KB Correct
241 Correct 7 ms 26460 KB Correct
242 Correct 7 ms 26548 KB Correct
243 Correct 9 ms 26460 KB Correct
244 Correct 10 ms 26460 KB Correct
245 Correct 11 ms 26460 KB Correct
246 Correct 8 ms 26316 KB Correct
247 Correct 7 ms 26716 KB Correct
248 Correct 7 ms 26676 KB Correct
249 Correct 7 ms 26460 KB Correct
250 Correct 193 ms 40000 KB Correct
251 Correct 172 ms 36232 KB Correct
252 Correct 37 ms 27752 KB Correct
253 Correct 71 ms 30708 KB Correct
254 Correct 144 ms 35072 KB Correct
255 Correct 157 ms 39544 KB Correct
256 Correct 173 ms 40388 KB Correct
257 Correct 168 ms 35100 KB Correct
258 Correct 123 ms 33540 KB Correct
259 Correct 118 ms 38728 KB Correct
260 Correct 168 ms 40172 KB Correct
261 Correct 77 ms 38756 KB Correct
262 Correct 100 ms 38748 KB Correct
263 Correct 77 ms 38848 KB Correct
264 Correct 107 ms 38824 KB Correct
265 Correct 80 ms 38848 KB Correct
266 Correct 85 ms 38820 KB Correct
267 Correct 105 ms 38936 KB Correct
268 Correct 88 ms 38952 KB Correct
269 Correct 109 ms 40252 KB Correct
270 Correct 90 ms 40136 KB Correct
271 Correct 66 ms 35212 KB Correct
272 Correct 39 ms 32276 KB Correct
273 Correct 63 ms 34248 KB Correct
274 Correct 10 ms 26460 KB Correct
275 Correct 9 ms 26472 KB Correct
276 Correct 6 ms 26480 KB Correct
277 Correct 6 ms 26456 KB Correct
278 Correct 153 ms 41152 KB Correct
279 Correct 173 ms 37440 KB Correct
280 Correct 26 ms 28372 KB Correct
281 Correct 165 ms 41200 KB Correct
282 Correct 161 ms 41408 KB Correct
283 Correct 185 ms 36348 KB Correct
284 Correct 149 ms 41536 KB Correct
285 Correct 5 ms 26204 KB Correct
286 Correct 6 ms 26220 KB Correct
287 Correct 5 ms 26204 KB Correct
288 Correct 7 ms 26204 KB Correct
289 Correct 5 ms 26204 KB Correct
290 Correct 5 ms 26368 KB Correct
291 Correct 5 ms 26204 KB Correct
292 Correct 27 ms 31296 KB Correct
293 Correct 7 ms 26204 KB Correct
294 Correct 10 ms 26716 KB Correct
295 Correct 9 ms 26460 KB Correct
296 Correct 8 ms 26716 KB Correct
297 Correct 11 ms 26460 KB Correct
298 Correct 193 ms 41968 KB Correct
299 Correct 207 ms 37760 KB Correct
300 Correct 178 ms 35776 KB Correct
301 Correct 182 ms 35776 KB Correct
302 Correct 167 ms 35264 KB Correct
303 Correct 203 ms 41280 KB Correct
304 Correct 188 ms 42344 KB Correct
305 Correct 200 ms 42536 KB Correct
306 Correct 188 ms 41408 KB Correct
307 Correct 193 ms 40680 KB Correct