Submission #1076373

# Submission time Handle Problem Language Result Execution time Memory
1076373 2024-08-26T13:24:03 Z bleahbleah Brought Down the Grading Server? (CEOI23_balance) C++17
100 / 100
313 ms 42940 KB
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;

using ll = long long;
using ld = long double;

//#define int ll
#define sz(x) ((int)(x).size())

using pii = pair<int,int>;
using tii = tuple<int,int,int>;
const int nmax = 5e5 + 5;

namespace Equalise {
   vector<pair<int*, int*>> edgeref;
   vector<int> g[nmax];
   int pointer[nmax], occ[nmax], deg[nmax];
   
   void add_edge(int *a, int *b) {
      if(*a == *b) return;
      deg[*a]++;
      deg[*b]++;
      g[*a].emplace_back(sz(edgeref));
      g[*b].emplace_back(sz(edgeref));
      edgeref.emplace_back(a, b);
   }
   void init(vector<int> V) {
      vector<int> st;
      for(int bit = 1; bit >= 0; bit--) {
         for(auto x : V) {
            st.emplace_back(x);
            while(!st.empty()) {
               int node = st.back();
               st.pop_back();
               if(deg[node] % 2 < bit) { st.clear(); break; }
               if(pointer[node] == sz(g[node])) continue;
               st.emplace_back(node);
               int u = g[node][pointer[node]++];
               if(occ[u] == 1) continue;
               
               occ[u] = 1;
               if(*edgeref[u].first != node) swap(*edgeref[u].first, *edgeref[u].second);
               
               //cerr << *edgeref[u].first << " --> " << *edgeref[u].second << '\n';
               
               deg[*edgeref[u].second]--;
               deg[node]--;
               
               st.emplace_back(*edgeref[u].second);
            }
         }
      }
      
      for(auto x : V) pointer[x] = 0, g[x].clear();
      for(int i = 0; i < sz(edgeref); i++) occ[i] = 0;
      edgeref.clear();
   }
}

vector<vector<int>> mat;

void divide(int l, int r) {
   if(l == r) return;
   int mid = (l + r) >> 1;
   vector<int> a;
   for(int t = mid, t1 = mid + 1; t >= l; t--, t1++) {
      for(int i = 0; i < sz(mat); i++)
         Equalise::add_edge(&mat[i][t], &mat[i][t1]), a.emplace_back(mat[i][t]), a.emplace_back(mat[i][t1]);
   }
   Equalise::init(a);
   
   divide(l, mid);
   divide(mid + 1, r);
   
}

signed main() {
   cin.tie(0) -> sync_with_stdio(0);
   int n, s, t;
   cin >> n >> s >> t; 
   mat.resize(n, vector<int>(s));
   for(auto &v : mat) for(auto &x : v) cin >> x;
   divide(0, s - 1);
   map<int,pii> cnt;
   for(int i = 0; i < 2; i++){
      for(int l = 0; l < n; l++) {
         if(i == 0) cnt[mat[l][i]].first++;
         if(i == 1) cnt[mat[l][i]].second++;
      }
   }
   
   for(auto &v : mat) { for(auto &x : v) cout << x << ' '; cout << '\n'; }
   return 0;
}

/**
      Töte es durch genaue Untersuchung\Töte es kann es nur noch schlimmer machen\Es lässt es irgendwie atmen
--
*/ 
# Verdict Execution time Memory Grader output
1 Correct 4 ms 13656 KB Correct
2 Correct 2 ms 13656 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 13660 KB Correct
2 Correct 3 ms 13660 KB Correct
3 Correct 3 ms 13800 KB Correct
4 Correct 3 ms 13660 KB Correct
5 Correct 3 ms 13660 KB Correct
6 Correct 2 ms 13804 KB Correct
7 Correct 3 ms 13800 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 143 ms 31680 KB Correct
2 Correct 107 ms 31688 KB Correct
3 Correct 87 ms 25468 KB Correct
4 Correct 47 ms 24696 KB Correct
5 Correct 86 ms 29612 KB Correct
6 Correct 136 ms 33828 KB Correct
7 Correct 123 ms 34756 KB Correct
8 Correct 111 ms 34800 KB Correct
9 Correct 109 ms 34840 KB Correct
10 Correct 73 ms 33436 KB Correct
11 Correct 78 ms 33276 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 143 ms 31680 KB Correct
2 Correct 107 ms 31688 KB Correct
3 Correct 87 ms 25468 KB Correct
4 Correct 47 ms 24696 KB Correct
5 Correct 86 ms 29612 KB Correct
6 Correct 136 ms 33828 KB Correct
7 Correct 123 ms 34756 KB Correct
8 Correct 111 ms 34800 KB Correct
9 Correct 109 ms 34840 KB Correct
10 Correct 73 ms 33436 KB Correct
11 Correct 78 ms 33276 KB Correct
12 Correct 114 ms 30092 KB Correct
13 Correct 119 ms 30232 KB Correct
14 Correct 88 ms 25480 KB Correct
15 Correct 42 ms 24844 KB Correct
16 Correct 91 ms 28068 KB Correct
17 Correct 133 ms 34056 KB Correct
18 Correct 123 ms 34836 KB Correct
19 Correct 127 ms 34964 KB Correct
20 Correct 118 ms 34836 KB Correct
21 Correct 93 ms 34992 KB Correct
22 Correct 78 ms 34680 KB Correct
23 Correct 135 ms 33776 KB Correct
24 Correct 51 ms 24944 KB Correct
25 Correct 105 ms 28016 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 13660 KB Correct
2 Correct 3 ms 13660 KB Correct
3 Correct 3 ms 13800 KB Correct
4 Correct 3 ms 13660 KB Correct
5 Correct 3 ms 13660 KB Correct
6 Correct 2 ms 13804 KB Correct
7 Correct 3 ms 13800 KB Correct
8 Correct 143 ms 31680 KB Correct
9 Correct 107 ms 31688 KB Correct
10 Correct 87 ms 25468 KB Correct
11 Correct 47 ms 24696 KB Correct
12 Correct 86 ms 29612 KB Correct
13 Correct 136 ms 33828 KB Correct
14 Correct 123 ms 34756 KB Correct
15 Correct 111 ms 34800 KB Correct
16 Correct 109 ms 34840 KB Correct
17 Correct 73 ms 33436 KB Correct
18 Correct 78 ms 33276 KB Correct
19 Correct 114 ms 30092 KB Correct
20 Correct 119 ms 30232 KB Correct
21 Correct 88 ms 25480 KB Correct
22 Correct 42 ms 24844 KB Correct
23 Correct 91 ms 28068 KB Correct
24 Correct 133 ms 34056 KB Correct
25 Correct 123 ms 34836 KB Correct
26 Correct 127 ms 34964 KB Correct
27 Correct 118 ms 34836 KB Correct
28 Correct 93 ms 34992 KB Correct
29 Correct 78 ms 34680 KB Correct
30 Correct 135 ms 33776 KB Correct
31 Correct 51 ms 24944 KB Correct
32 Correct 105 ms 28016 KB Correct
33 Correct 3 ms 13756 KB Correct
34 Correct 3 ms 13660 KB Correct
35 Correct 4 ms 13660 KB Correct
36 Correct 4 ms 13660 KB Correct
37 Correct 3 ms 13656 KB Correct
38 Correct 2 ms 13804 KB Correct
39 Correct 3 ms 13660 KB Correct
40 Correct 120 ms 32012 KB Correct
41 Correct 105 ms 32064 KB Correct
42 Correct 80 ms 25692 KB Correct
43 Correct 40 ms 24880 KB Correct
44 Correct 83 ms 30124 KB Correct
45 Correct 131 ms 34376 KB Correct
46 Correct 127 ms 35116 KB Correct
47 Correct 112 ms 35308 KB Correct
48 Correct 112 ms 35064 KB Correct
49 Correct 69 ms 35388 KB Correct
50 Correct 75 ms 35064 KB Correct
51 Correct 140 ms 33968 KB Correct
52 Correct 54 ms 25072 KB Correct
53 Correct 111 ms 28128 KB Correct
54 Correct 63 ms 26952 KB Correct
55 Correct 3 ms 16476 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 13660 KB Correct
2 Correct 7 ms 14172 KB Correct
3 Correct 7 ms 14064 KB Correct
4 Correct 6 ms 14240 KB Correct
5 Correct 4 ms 14172 KB Correct
6 Correct 6 ms 14604 KB Correct
7 Correct 6 ms 14172 KB Correct
8 Correct 6 ms 14172 KB Correct
9 Correct 6 ms 14172 KB Correct
10 Correct 7 ms 14172 KB Correct
11 Correct 6 ms 14172 KB Correct
12 Correct 8 ms 14636 KB Correct
13 Correct 6 ms 14684 KB Correct
14 Correct 6 ms 14684 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 13660 KB Correct
2 Correct 7 ms 14172 KB Correct
3 Correct 7 ms 14064 KB Correct
4 Correct 6 ms 14240 KB Correct
5 Correct 4 ms 14172 KB Correct
6 Correct 6 ms 14604 KB Correct
7 Correct 6 ms 14172 KB Correct
8 Correct 6 ms 14172 KB Correct
9 Correct 6 ms 14172 KB Correct
10 Correct 7 ms 14172 KB Correct
11 Correct 6 ms 14172 KB Correct
12 Correct 8 ms 14636 KB Correct
13 Correct 6 ms 14684 KB Correct
14 Correct 6 ms 14684 KB Correct
15 Correct 3 ms 13796 KB Correct
16 Correct 8 ms 14264 KB Correct
17 Correct 6 ms 14124 KB Correct
18 Correct 6 ms 14172 KB Correct
19 Correct 4 ms 14172 KB Correct
20 Correct 5 ms 14428 KB Correct
21 Correct 5 ms 14168 KB Correct
22 Correct 5 ms 14312 KB Correct
23 Correct 7 ms 14264 KB Correct
24 Correct 6 ms 14172 KB Correct
25 Correct 5 ms 14276 KB Correct
26 Correct 6 ms 14684 KB Correct
27 Correct 6 ms 14764 KB Correct
28 Correct 6 ms 14628 KB Correct
29 Correct 5 ms 14168 KB Correct
30 Correct 6 ms 14324 KB Correct
31 Correct 6 ms 14188 KB Correct
32 Correct 6 ms 14428 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 13660 KB Correct
2 Correct 7 ms 14172 KB Correct
3 Correct 7 ms 14064 KB Correct
4 Correct 6 ms 14240 KB Correct
5 Correct 4 ms 14172 KB Correct
6 Correct 6 ms 14604 KB Correct
7 Correct 6 ms 14172 KB Correct
8 Correct 6 ms 14172 KB Correct
9 Correct 6 ms 14172 KB Correct
10 Correct 7 ms 14172 KB Correct
11 Correct 6 ms 14172 KB Correct
12 Correct 8 ms 14636 KB Correct
13 Correct 6 ms 14684 KB Correct
14 Correct 6 ms 14684 KB Correct
15 Correct 3 ms 13796 KB Correct
16 Correct 8 ms 14264 KB Correct
17 Correct 6 ms 14124 KB Correct
18 Correct 6 ms 14172 KB Correct
19 Correct 4 ms 14172 KB Correct
20 Correct 5 ms 14428 KB Correct
21 Correct 5 ms 14168 KB Correct
22 Correct 5 ms 14312 KB Correct
23 Correct 7 ms 14264 KB Correct
24 Correct 6 ms 14172 KB Correct
25 Correct 5 ms 14276 KB Correct
26 Correct 6 ms 14684 KB Correct
27 Correct 6 ms 14764 KB Correct
28 Correct 6 ms 14628 KB Correct
29 Correct 5 ms 14168 KB Correct
30 Correct 6 ms 14324 KB Correct
31 Correct 6 ms 14188 KB Correct
32 Correct 6 ms 14428 KB Correct
33 Correct 2 ms 13796 KB Correct
34 Correct 6 ms 14172 KB Correct
35 Correct 8 ms 13916 KB Correct
36 Correct 5 ms 14172 KB Correct
37 Correct 5 ms 14320 KB Correct
38 Correct 6 ms 14428 KB Correct
39 Correct 6 ms 14172 KB Correct
40 Correct 7 ms 14172 KB Correct
41 Correct 8 ms 14172 KB Correct
42 Correct 11 ms 12636 KB Correct
43 Correct 7 ms 12636 KB Correct
44 Correct 9 ms 13148 KB Correct
45 Correct 13 ms 13148 KB Correct
46 Correct 8 ms 13044 KB Correct
47 Correct 11 ms 14172 KB Correct
48 Correct 13 ms 14220 KB Correct
49 Correct 8 ms 14192 KB Correct
50 Correct 10 ms 14428 KB Correct
51 Correct 5 ms 13660 KB Correct
52 Correct 7 ms 13660 KB Correct
53 Correct 5 ms 13660 KB Correct
54 Correct 8 ms 13604 KB Correct
55 Correct 6 ms 13820 KB Correct
56 Correct 3 ms 13660 KB Correct
57 Correct 4 ms 13660 KB Correct
58 Correct 7 ms 16988 KB Correct
59 Correct 8 ms 16888 KB Correct
60 Correct 7 ms 14428 KB Correct
61 Correct 7 ms 16772 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 143 ms 31680 KB Correct
2 Correct 107 ms 31688 KB Correct
3 Correct 87 ms 25468 KB Correct
4 Correct 47 ms 24696 KB Correct
5 Correct 86 ms 29612 KB Correct
6 Correct 136 ms 33828 KB Correct
7 Correct 123 ms 34756 KB Correct
8 Correct 111 ms 34800 KB Correct
9 Correct 109 ms 34840 KB Correct
10 Correct 73 ms 33436 KB Correct
11 Correct 78 ms 33276 KB Correct
12 Correct 3 ms 13660 KB Correct
13 Correct 7 ms 14172 KB Correct
14 Correct 7 ms 14064 KB Correct
15 Correct 6 ms 14240 KB Correct
16 Correct 4 ms 14172 KB Correct
17 Correct 6 ms 14604 KB Correct
18 Correct 6 ms 14172 KB Correct
19 Correct 6 ms 14172 KB Correct
20 Correct 6 ms 14172 KB Correct
21 Correct 7 ms 14172 KB Correct
22 Correct 6 ms 14172 KB Correct
23 Correct 8 ms 14636 KB Correct
24 Correct 6 ms 14684 KB Correct
25 Correct 6 ms 14684 KB Correct
26 Correct 134 ms 31560 KB Correct
27 Correct 122 ms 31672 KB Correct
28 Correct 94 ms 25376 KB Correct
29 Correct 41 ms 24724 KB Correct
30 Correct 97 ms 29608 KB Correct
31 Correct 153 ms 34016 KB Correct
32 Correct 158 ms 34840 KB Correct
33 Correct 132 ms 34980 KB Correct
34 Correct 118 ms 34784 KB Correct
35 Correct 70 ms 34868 KB Correct
36 Correct 102 ms 34720 KB Correct
37 Correct 2 ms 13660 KB Correct
38 Correct 8 ms 14068 KB Correct
39 Correct 9 ms 14028 KB Correct
40 Correct 7 ms 14172 KB Correct
41 Correct 5 ms 14328 KB Correct
42 Correct 6 ms 14424 KB Correct
43 Correct 7 ms 14172 KB Correct
44 Correct 7 ms 14172 KB Correct
45 Correct 5 ms 14172 KB Correct
46 Correct 7 ms 14172 KB Correct
47 Correct 7 ms 14264 KB Correct
48 Correct 8 ms 14604 KB Correct
49 Correct 7 ms 14584 KB Correct
50 Correct 6 ms 14684 KB Correct
51 Correct 300 ms 36068 KB Correct
52 Correct 263 ms 30056 KB Correct
53 Correct 58 ms 16484 KB Correct
54 Correct 69 ms 19544 KB Correct
55 Correct 246 ms 26812 KB Correct
56 Correct 256 ms 33512 KB Correct
57 Correct 266 ms 37188 KB Correct
58 Correct 222 ms 26936 KB Correct
59 Correct 177 ms 23520 KB Correct
60 Correct 192 ms 34768 KB Correct
61 Correct 264 ms 37180 KB Correct
62 Correct 118 ms 36456 KB Correct
63 Correct 128 ms 36764 KB Correct
64 Correct 107 ms 36636 KB Correct
65 Correct 97 ms 36472 KB Correct
66 Correct 118 ms 36468 KB Correct
67 Correct 131 ms 36620 KB Correct
68 Correct 103 ms 36484 KB Correct
69 Correct 100 ms 36484 KB Correct
70 Correct 128 ms 33056 KB Correct
71 Correct 108 ms 33496 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 143 ms 31680 KB Correct
2 Correct 107 ms 31688 KB Correct
3 Correct 87 ms 25468 KB Correct
4 Correct 47 ms 24696 KB Correct
5 Correct 86 ms 29612 KB Correct
6 Correct 136 ms 33828 KB Correct
7 Correct 123 ms 34756 KB Correct
8 Correct 111 ms 34800 KB Correct
9 Correct 109 ms 34840 KB Correct
10 Correct 73 ms 33436 KB Correct
11 Correct 78 ms 33276 KB Correct
12 Correct 114 ms 30092 KB Correct
13 Correct 119 ms 30232 KB Correct
14 Correct 88 ms 25480 KB Correct
15 Correct 42 ms 24844 KB Correct
16 Correct 91 ms 28068 KB Correct
17 Correct 133 ms 34056 KB Correct
18 Correct 123 ms 34836 KB Correct
19 Correct 127 ms 34964 KB Correct
20 Correct 118 ms 34836 KB Correct
21 Correct 93 ms 34992 KB Correct
22 Correct 78 ms 34680 KB Correct
23 Correct 135 ms 33776 KB Correct
24 Correct 51 ms 24944 KB Correct
25 Correct 105 ms 28016 KB Correct
26 Correct 3 ms 13660 KB Correct
27 Correct 7 ms 14172 KB Correct
28 Correct 7 ms 14064 KB Correct
29 Correct 6 ms 14240 KB Correct
30 Correct 4 ms 14172 KB Correct
31 Correct 6 ms 14604 KB Correct
32 Correct 6 ms 14172 KB Correct
33 Correct 6 ms 14172 KB Correct
34 Correct 6 ms 14172 KB Correct
35 Correct 7 ms 14172 KB Correct
36 Correct 6 ms 14172 KB Correct
37 Correct 8 ms 14636 KB Correct
38 Correct 6 ms 14684 KB Correct
39 Correct 6 ms 14684 KB Correct
40 Correct 3 ms 13796 KB Correct
41 Correct 8 ms 14264 KB Correct
42 Correct 6 ms 14124 KB Correct
43 Correct 6 ms 14172 KB Correct
44 Correct 4 ms 14172 KB Correct
45 Correct 5 ms 14428 KB Correct
46 Correct 5 ms 14168 KB Correct
47 Correct 5 ms 14312 KB Correct
48 Correct 7 ms 14264 KB Correct
49 Correct 6 ms 14172 KB Correct
50 Correct 5 ms 14276 KB Correct
51 Correct 6 ms 14684 KB Correct
52 Correct 6 ms 14764 KB Correct
53 Correct 6 ms 14628 KB Correct
54 Correct 5 ms 14168 KB Correct
55 Correct 6 ms 14324 KB Correct
56 Correct 6 ms 14188 KB Correct
57 Correct 6 ms 14428 KB Correct
58 Correct 134 ms 31560 KB Correct
59 Correct 122 ms 31672 KB Correct
60 Correct 94 ms 25376 KB Correct
61 Correct 41 ms 24724 KB Correct
62 Correct 97 ms 29608 KB Correct
63 Correct 153 ms 34016 KB Correct
64 Correct 158 ms 34840 KB Correct
65 Correct 132 ms 34980 KB Correct
66 Correct 118 ms 34784 KB Correct
67 Correct 70 ms 34868 KB Correct
68 Correct 102 ms 34720 KB Correct
69 Correct 2 ms 13660 KB Correct
70 Correct 8 ms 14068 KB Correct
71 Correct 9 ms 14028 KB Correct
72 Correct 7 ms 14172 KB Correct
73 Correct 5 ms 14328 KB Correct
74 Correct 6 ms 14424 KB Correct
75 Correct 7 ms 14172 KB Correct
76 Correct 7 ms 14172 KB Correct
77 Correct 5 ms 14172 KB Correct
78 Correct 7 ms 14172 KB Correct
79 Correct 7 ms 14264 KB Correct
80 Correct 8 ms 14604 KB Correct
81 Correct 7 ms 14584 KB Correct
82 Correct 6 ms 14684 KB Correct
83 Correct 300 ms 36068 KB Correct
84 Correct 263 ms 30056 KB Correct
85 Correct 58 ms 16484 KB Correct
86 Correct 69 ms 19544 KB Correct
87 Correct 246 ms 26812 KB Correct
88 Correct 256 ms 33512 KB Correct
89 Correct 266 ms 37188 KB Correct
90 Correct 222 ms 26936 KB Correct
91 Correct 177 ms 23520 KB Correct
92 Correct 192 ms 34768 KB Correct
93 Correct 264 ms 37180 KB Correct
94 Correct 118 ms 36456 KB Correct
95 Correct 128 ms 36764 KB Correct
96 Correct 107 ms 36636 KB Correct
97 Correct 97 ms 36472 KB Correct
98 Correct 118 ms 36468 KB Correct
99 Correct 131 ms 36620 KB Correct
100 Correct 103 ms 36484 KB Correct
101 Correct 100 ms 36484 KB Correct
102 Correct 128 ms 33056 KB Correct
103 Correct 108 ms 33496 KB Correct
104 Correct 133 ms 32096 KB Correct
105 Correct 96 ms 32056 KB Correct
106 Correct 89 ms 25488 KB Correct
107 Correct 36 ms 24920 KB Correct
108 Correct 93 ms 30120 KB Correct
109 Correct 124 ms 34444 KB Correct
110 Correct 116 ms 35084 KB Correct
111 Correct 111 ms 35192 KB Correct
112 Correct 148 ms 35060 KB Correct
113 Correct 81 ms 35228 KB Correct
114 Correct 70 ms 35308 KB Correct
115 Correct 3 ms 13660 KB Correct
116 Correct 6 ms 14272 KB Correct
117 Correct 7 ms 14072 KB Correct
118 Correct 6 ms 14324 KB Correct
119 Correct 5 ms 14172 KB Correct
120 Correct 7 ms 14428 KB Correct
121 Correct 5 ms 14172 KB Correct
122 Correct 8 ms 14192 KB Correct
123 Correct 7 ms 14172 KB Correct
124 Correct 6 ms 14172 KB Correct
125 Correct 5 ms 14172 KB Correct
126 Correct 9 ms 14684 KB Correct
127 Correct 7 ms 14684 KB Correct
128 Correct 5 ms 14684 KB Correct
129 Correct 264 ms 37316 KB Correct
130 Correct 272 ms 30780 KB Correct
131 Correct 55 ms 16680 KB Correct
132 Correct 79 ms 19736 KB Correct
133 Correct 206 ms 27548 KB Correct
134 Correct 224 ms 36372 KB Correct
135 Correct 242 ms 40240 KB Correct
136 Correct 226 ms 27428 KB Correct
137 Correct 191 ms 23716 KB Correct
138 Correct 195 ms 35652 KB Correct
139 Correct 241 ms 37712 KB Correct
140 Correct 107 ms 37720 KB Correct
141 Correct 128 ms 37612 KB Correct
142 Correct 101 ms 38020 KB Correct
143 Correct 102 ms 37620 KB Correct
144 Correct 100 ms 37612 KB Correct
145 Correct 128 ms 37608 KB Correct
146 Correct 122 ms 37584 KB Correct
147 Correct 105 ms 37572 KB Correct
148 Correct 111 ms 34156 KB Correct
149 Correct 116 ms 34480 KB Correct
150 Correct 137 ms 33976 KB Correct
151 Correct 52 ms 24980 KB Correct
152 Correct 104 ms 28084 KB Correct
153 Correct 6 ms 14172 KB Correct
154 Correct 7 ms 14172 KB Correct
155 Correct 5 ms 14172 KB Correct
156 Correct 7 ms 14360 KB Correct
157 Correct 253 ms 38972 KB Correct
158 Correct 276 ms 31628 KB Correct
159 Correct 43 ms 17480 KB Correct
160 Correct 283 ms 39540 KB Correct
161 Correct 310 ms 39660 KB Correct
162 Correct 250 ms 27140 KB Correct
163 Correct 263 ms 38844 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 13656 KB Correct
2 Correct 2 ms 13656 KB Correct
3 Correct 4 ms 13660 KB Correct
4 Correct 3 ms 13660 KB Correct
5 Correct 3 ms 13800 KB Correct
6 Correct 3 ms 13660 KB Correct
7 Correct 3 ms 13660 KB Correct
8 Correct 2 ms 13804 KB Correct
9 Correct 3 ms 13800 KB Correct
10 Correct 143 ms 31680 KB Correct
11 Correct 107 ms 31688 KB Correct
12 Correct 87 ms 25468 KB Correct
13 Correct 47 ms 24696 KB Correct
14 Correct 86 ms 29612 KB Correct
15 Correct 136 ms 33828 KB Correct
16 Correct 123 ms 34756 KB Correct
17 Correct 111 ms 34800 KB Correct
18 Correct 109 ms 34840 KB Correct
19 Correct 73 ms 33436 KB Correct
20 Correct 78 ms 33276 KB Correct
21 Correct 114 ms 30092 KB Correct
22 Correct 119 ms 30232 KB Correct
23 Correct 88 ms 25480 KB Correct
24 Correct 42 ms 24844 KB Correct
25 Correct 91 ms 28068 KB Correct
26 Correct 133 ms 34056 KB Correct
27 Correct 123 ms 34836 KB Correct
28 Correct 127 ms 34964 KB Correct
29 Correct 118 ms 34836 KB Correct
30 Correct 93 ms 34992 KB Correct
31 Correct 78 ms 34680 KB Correct
32 Correct 135 ms 33776 KB Correct
33 Correct 51 ms 24944 KB Correct
34 Correct 105 ms 28016 KB Correct
35 Correct 3 ms 13756 KB Correct
36 Correct 3 ms 13660 KB Correct
37 Correct 4 ms 13660 KB Correct
38 Correct 4 ms 13660 KB Correct
39 Correct 3 ms 13656 KB Correct
40 Correct 2 ms 13804 KB Correct
41 Correct 3 ms 13660 KB Correct
42 Correct 120 ms 32012 KB Correct
43 Correct 105 ms 32064 KB Correct
44 Correct 80 ms 25692 KB Correct
45 Correct 40 ms 24880 KB Correct
46 Correct 83 ms 30124 KB Correct
47 Correct 131 ms 34376 KB Correct
48 Correct 127 ms 35116 KB Correct
49 Correct 112 ms 35308 KB Correct
50 Correct 112 ms 35064 KB Correct
51 Correct 69 ms 35388 KB Correct
52 Correct 75 ms 35064 KB Correct
53 Correct 140 ms 33968 KB Correct
54 Correct 54 ms 25072 KB Correct
55 Correct 111 ms 28128 KB Correct
56 Correct 63 ms 26952 KB Correct
57 Correct 3 ms 16476 KB Correct
58 Correct 3 ms 13660 KB Correct
59 Correct 7 ms 14172 KB Correct
60 Correct 7 ms 14064 KB Correct
61 Correct 6 ms 14240 KB Correct
62 Correct 4 ms 14172 KB Correct
63 Correct 6 ms 14604 KB Correct
64 Correct 6 ms 14172 KB Correct
65 Correct 6 ms 14172 KB Correct
66 Correct 6 ms 14172 KB Correct
67 Correct 7 ms 14172 KB Correct
68 Correct 6 ms 14172 KB Correct
69 Correct 8 ms 14636 KB Correct
70 Correct 6 ms 14684 KB Correct
71 Correct 6 ms 14684 KB Correct
72 Correct 3 ms 13796 KB Correct
73 Correct 8 ms 14264 KB Correct
74 Correct 6 ms 14124 KB Correct
75 Correct 6 ms 14172 KB Correct
76 Correct 4 ms 14172 KB Correct
77 Correct 5 ms 14428 KB Correct
78 Correct 5 ms 14168 KB Correct
79 Correct 5 ms 14312 KB Correct
80 Correct 7 ms 14264 KB Correct
81 Correct 6 ms 14172 KB Correct
82 Correct 5 ms 14276 KB Correct
83 Correct 6 ms 14684 KB Correct
84 Correct 6 ms 14764 KB Correct
85 Correct 6 ms 14628 KB Correct
86 Correct 5 ms 14168 KB Correct
87 Correct 6 ms 14324 KB Correct
88 Correct 6 ms 14188 KB Correct
89 Correct 6 ms 14428 KB Correct
90 Correct 2 ms 13796 KB Correct
91 Correct 6 ms 14172 KB Correct
92 Correct 8 ms 13916 KB Correct
93 Correct 5 ms 14172 KB Correct
94 Correct 5 ms 14320 KB Correct
95 Correct 6 ms 14428 KB Correct
96 Correct 6 ms 14172 KB Correct
97 Correct 7 ms 14172 KB Correct
98 Correct 8 ms 14172 KB Correct
99 Correct 11 ms 12636 KB Correct
100 Correct 7 ms 12636 KB Correct
101 Correct 9 ms 13148 KB Correct
102 Correct 13 ms 13148 KB Correct
103 Correct 8 ms 13044 KB Correct
104 Correct 11 ms 14172 KB Correct
105 Correct 13 ms 14220 KB Correct
106 Correct 8 ms 14192 KB Correct
107 Correct 10 ms 14428 KB Correct
108 Correct 5 ms 13660 KB Correct
109 Correct 7 ms 13660 KB Correct
110 Correct 5 ms 13660 KB Correct
111 Correct 8 ms 13604 KB Correct
112 Correct 6 ms 13820 KB Correct
113 Correct 3 ms 13660 KB Correct
114 Correct 4 ms 13660 KB Correct
115 Correct 7 ms 16988 KB Correct
116 Correct 8 ms 16888 KB Correct
117 Correct 7 ms 14428 KB Correct
118 Correct 7 ms 16772 KB Correct
119 Correct 134 ms 31560 KB Correct
120 Correct 122 ms 31672 KB Correct
121 Correct 94 ms 25376 KB Correct
122 Correct 41 ms 24724 KB Correct
123 Correct 97 ms 29608 KB Correct
124 Correct 153 ms 34016 KB Correct
125 Correct 158 ms 34840 KB Correct
126 Correct 132 ms 34980 KB Correct
127 Correct 118 ms 34784 KB Correct
128 Correct 70 ms 34868 KB Correct
129 Correct 102 ms 34720 KB Correct
130 Correct 2 ms 13660 KB Correct
131 Correct 8 ms 14068 KB Correct
132 Correct 9 ms 14028 KB Correct
133 Correct 7 ms 14172 KB Correct
134 Correct 5 ms 14328 KB Correct
135 Correct 6 ms 14424 KB Correct
136 Correct 7 ms 14172 KB Correct
137 Correct 7 ms 14172 KB Correct
138 Correct 5 ms 14172 KB Correct
139 Correct 7 ms 14172 KB Correct
140 Correct 7 ms 14264 KB Correct
141 Correct 8 ms 14604 KB Correct
142 Correct 7 ms 14584 KB Correct
143 Correct 6 ms 14684 KB Correct
144 Correct 300 ms 36068 KB Correct
145 Correct 263 ms 30056 KB Correct
146 Correct 58 ms 16484 KB Correct
147 Correct 69 ms 19544 KB Correct
148 Correct 246 ms 26812 KB Correct
149 Correct 256 ms 33512 KB Correct
150 Correct 266 ms 37188 KB Correct
151 Correct 222 ms 26936 KB Correct
152 Correct 177 ms 23520 KB Correct
153 Correct 192 ms 34768 KB Correct
154 Correct 264 ms 37180 KB Correct
155 Correct 118 ms 36456 KB Correct
156 Correct 128 ms 36764 KB Correct
157 Correct 107 ms 36636 KB Correct
158 Correct 97 ms 36472 KB Correct
159 Correct 118 ms 36468 KB Correct
160 Correct 131 ms 36620 KB Correct
161 Correct 103 ms 36484 KB Correct
162 Correct 100 ms 36484 KB Correct
163 Correct 128 ms 33056 KB Correct
164 Correct 108 ms 33496 KB Correct
165 Correct 133 ms 32096 KB Correct
166 Correct 96 ms 32056 KB Correct
167 Correct 89 ms 25488 KB Correct
168 Correct 36 ms 24920 KB Correct
169 Correct 93 ms 30120 KB Correct
170 Correct 124 ms 34444 KB Correct
171 Correct 116 ms 35084 KB Correct
172 Correct 111 ms 35192 KB Correct
173 Correct 148 ms 35060 KB Correct
174 Correct 81 ms 35228 KB Correct
175 Correct 70 ms 35308 KB Correct
176 Correct 3 ms 13660 KB Correct
177 Correct 6 ms 14272 KB Correct
178 Correct 7 ms 14072 KB Correct
179 Correct 6 ms 14324 KB Correct
180 Correct 5 ms 14172 KB Correct
181 Correct 7 ms 14428 KB Correct
182 Correct 5 ms 14172 KB Correct
183 Correct 8 ms 14192 KB Correct
184 Correct 7 ms 14172 KB Correct
185 Correct 6 ms 14172 KB Correct
186 Correct 5 ms 14172 KB Correct
187 Correct 9 ms 14684 KB Correct
188 Correct 7 ms 14684 KB Correct
189 Correct 5 ms 14684 KB Correct
190 Correct 264 ms 37316 KB Correct
191 Correct 272 ms 30780 KB Correct
192 Correct 55 ms 16680 KB Correct
193 Correct 79 ms 19736 KB Correct
194 Correct 206 ms 27548 KB Correct
195 Correct 224 ms 36372 KB Correct
196 Correct 242 ms 40240 KB Correct
197 Correct 226 ms 27428 KB Correct
198 Correct 191 ms 23716 KB Correct
199 Correct 195 ms 35652 KB Correct
200 Correct 241 ms 37712 KB Correct
201 Correct 107 ms 37720 KB Correct
202 Correct 128 ms 37612 KB Correct
203 Correct 101 ms 38020 KB Correct
204 Correct 102 ms 37620 KB Correct
205 Correct 100 ms 37612 KB Correct
206 Correct 128 ms 37608 KB Correct
207 Correct 122 ms 37584 KB Correct
208 Correct 105 ms 37572 KB Correct
209 Correct 111 ms 34156 KB Correct
210 Correct 116 ms 34480 KB Correct
211 Correct 137 ms 33976 KB Correct
212 Correct 52 ms 24980 KB Correct
213 Correct 104 ms 28084 KB Correct
214 Correct 6 ms 14172 KB Correct
215 Correct 7 ms 14172 KB Correct
216 Correct 5 ms 14172 KB Correct
217 Correct 7 ms 14360 KB Correct
218 Correct 253 ms 38972 KB Correct
219 Correct 276 ms 31628 KB Correct
220 Correct 43 ms 17480 KB Correct
221 Correct 283 ms 39540 KB Correct
222 Correct 310 ms 39660 KB Correct
223 Correct 250 ms 27140 KB Correct
224 Correct 263 ms 38844 KB Correct
225 Correct 143 ms 30524 KB Correct
226 Correct 115 ms 32112 KB Correct
227 Correct 86 ms 25676 KB Correct
228 Correct 39 ms 24724 KB Correct
229 Correct 108 ms 30048 KB Correct
230 Correct 114 ms 34332 KB Correct
231 Correct 113 ms 35104 KB Correct
232 Correct 111 ms 35196 KB Correct
233 Correct 100 ms 35228 KB Correct
234 Correct 75 ms 35216 KB Correct
235 Correct 79 ms 33504 KB Correct
236 Correct 3 ms 13796 KB Correct
237 Correct 9 ms 14172 KB Correct
238 Correct 8 ms 13916 KB Correct
239 Correct 6 ms 14172 KB Correct
240 Correct 4 ms 14336 KB Correct
241 Correct 6 ms 14428 KB Correct
242 Correct 5 ms 14172 KB Correct
243 Correct 9 ms 14172 KB Correct
244 Correct 10 ms 14168 KB Correct
245 Correct 7 ms 14172 KB Correct
246 Correct 6 ms 14172 KB Correct
247 Correct 10 ms 14684 KB Correct
248 Correct 8 ms 14584 KB Correct
249 Correct 6 ms 14576 KB Correct
250 Correct 299 ms 37008 KB Correct
251 Correct 287 ms 30656 KB Correct
252 Correct 54 ms 16484 KB Correct
253 Correct 76 ms 19608 KB Correct
254 Correct 250 ms 28716 KB Correct
255 Correct 258 ms 36448 KB Correct
256 Correct 296 ms 38296 KB Correct
257 Correct 252 ms 27320 KB Correct
258 Correct 203 ms 23776 KB Correct
259 Correct 213 ms 36568 KB Correct
260 Correct 278 ms 37736 KB Correct
261 Correct 130 ms 37576 KB Correct
262 Correct 116 ms 37728 KB Correct
263 Correct 128 ms 37488 KB Correct
264 Correct 112 ms 37500 KB Correct
265 Correct 123 ms 37492 KB Correct
266 Correct 117 ms 37600 KB Correct
267 Correct 112 ms 37476 KB Correct
268 Correct 121 ms 37608 KB Correct
269 Correct 134 ms 34136 KB Correct
270 Correct 165 ms 34348 KB Correct
271 Correct 124 ms 34028 KB Correct
272 Correct 51 ms 25036 KB Correct
273 Correct 102 ms 28140 KB Correct
274 Correct 6 ms 14132 KB Correct
275 Correct 8 ms 14244 KB Correct
276 Correct 7 ms 14172 KB Correct
277 Correct 6 ms 14428 KB Correct
278 Correct 313 ms 38940 KB Correct
279 Correct 290 ms 31792 KB Correct
280 Correct 35 ms 17480 KB Correct
281 Correct 279 ms 39616 KB Correct
282 Correct 276 ms 39760 KB Correct
283 Correct 222 ms 27664 KB Correct
284 Correct 233 ms 40636 KB Correct
285 Correct 3 ms 13916 KB Correct
286 Correct 3 ms 13660 KB Correct
287 Correct 3 ms 13820 KB Correct
288 Correct 4 ms 13660 KB Correct
289 Correct 3 ms 13660 KB Correct
290 Correct 3 ms 13660 KB Correct
291 Correct 3 ms 13752 KB Correct
292 Correct 74 ms 26944 KB Correct
293 Correct 5 ms 16476 KB Correct
294 Correct 8 ms 16988 KB Correct
295 Correct 7 ms 16912 KB Correct
296 Correct 7 ms 14428 KB Correct
297 Correct 7 ms 16732 KB Correct
298 Correct 268 ms 41508 KB Correct
299 Correct 306 ms 31788 KB Correct
300 Correct 212 ms 27392 KB Correct
301 Correct 235 ms 27220 KB Correct
302 Correct 212 ms 28324 KB Correct
303 Correct 246 ms 39692 KB Correct
304 Correct 260 ms 42940 KB Correct
305 Correct 258 ms 42940 KB Correct
306 Correct 251 ms 39184 KB Correct
307 Correct 233 ms 38276 KB Correct