#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long ll;
struct Node{
int mx, mx2, f, s;
void upd(int val, int i){
if(i != f && i != s){
if(val > mx){
s = f;
mx2 = mx;
f = i;
mx = val;
}else if(val > mx2){
s = i;
mx2 = val;
}
}else if(i == f && i != s){
//The second maximum remains the same, I can only change the first maximum.
if(val > mx){
f = i;
mx = val;
}
}else if(i != f && i == s){
//I can either change the first maximum and set it to second maximum, or change directly the second maximum, so proceed as normal.
if(val > mx){
s = f;
mx2 = mx;
f = i;
mx = val;
}else if(val > mx2){
s = i;
mx2 = val;
}
}
}
};
int n, m;
void process(vector<Node>& mx, vector<int>& changed){
vector<bool> vis((1 << m), 0);
priority_queue<pair<int, int>> q;
for(int i = 0; i < n; i++){
int bits = 0;
for(int j = 0; j < m; j++){
if((changed[i] & (1 << j))) bits++;
}
q.push({bits, changed[i]}); //If it takes the greater first, I want to go "down" (i.e. to masks with less bits on).
mx[changed[i]].upd(bits, i);
}
while(!q.empty()){
int bits = q.top().first; int x = q.top().second; q.pop();
if(vis[x]) continue;
vis[x] = 1;
for(int j = 0; j < m; j++){
if((1 << j) & x){
int nw = x - (1 << j);
pair<int, int> init = {mx[nw].mx, mx[nw].mx2};
mx[nw].upd(mx[x].mx - 1, mx[x].f); //Because in this Dijkstra I'm only visiting the masks that are fully contained by an element. So they will all be full, and I only
mx[nw].upd(mx[x].mx2 - 1, mx[x].s); //substract the bit that I am substracting.
pair<int, int> after = {mx[nw].mx, mx[nw].mx2};
if(init != after) q.push({bits - 1, nw});
}
}
}
vis.assign((1 << m), 0);
for(int i = 0; i < (1 << m); i++){
int bits = 0;
for(int j = 0; j < m; j++){
if((1 << j) & i) bits++;
}
if(mx[i].mx != -1) q.push({-bits, i});
}
while(!q.empty()){
int bits = -q.top().first; int x = q.top().second; q.pop();
if(vis[x]) continue;
vis[x] = 1;
for(int j = 0; j < m; j++){
if(!((1 << j) & x)){
int nw = x + (1 << j);
pair<int, int> init = {mx[nw].mx, mx[nw].mx2};
mx[nw].upd(mx[x].mx, mx[x].f);
mx[nw].upd(mx[x].mx2, mx[x].s);
pair<int, int> after = {mx[nw].mx, mx[nw].mx2};
if(init != after) q.push({-(bits + 1), nw});
}
}
}
}
void solve(){
cin >> n >> m;
int obj = n / 2;
vector<int> a(n);
vector<int> changed(n);
vector<int> cnt(m, 0);
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
int x; cin >> x;
if(x == 1) {a[i] += (1 << j); cnt[j]++;}
else changed[i] += (1 << j);
}
}
vector<Node> mx((1 << m), {-1, -1, -1, -1});
process(mx, changed);
for(int i = 0; i < n; i++){
int add = 0;
int mask = 0; //Here I add the ones that are exactly obj, so I want the other to have 0 in it so I don't lose it.
for(int j = 0; j < m; j++){
int v = cnt[j];
if((1 << j) & a[i]) v--;
if(v > obj) add++;
else if(v == obj) mask += (1 << j);
}
int ans;
if(mx[mask].f == i) ans = add + max(0, mx[mask].mx2);
else ans = add + max(0, mx[mask].mx);
cout << ans << endl;
}
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
//~ int tt; cin >> tt;
int tt = 1;
for(int t = 1; t <= tt; t++){
solve();
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
324 KB |
Output is correct |
4 |
Correct |
1 ms |
316 KB |
Output is correct |
5 |
Correct |
411 ms |
25100 KB |
Output is correct |
6 |
Correct |
223 ms |
19056 KB |
Output is correct |
7 |
Correct |
533 ms |
21004 KB |
Output is correct |
8 |
Correct |
551 ms |
21060 KB |
Output is correct |
9 |
Correct |
670 ms |
21120 KB |
Output is correct |
10 |
Correct |
505 ms |
21056 KB |
Output is correct |
11 |
Correct |
576 ms |
21040 KB |
Output is correct |
12 |
Correct |
630 ms |
21056 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
320 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
316 KB |
Output is correct |
18 |
Correct |
0 ms |
324 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
324 KB |
Output is correct |
21 |
Correct |
1 ms |
212 KB |
Output is correct |
22 |
Correct |
1 ms |
320 KB |
Output is correct |
23 |
Correct |
1 ms |
212 KB |
Output is correct |
24 |
Correct |
1 ms |
316 KB |
Output is correct |
25 |
Correct |
1 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
1 ms |
316 KB |
Output is correct |
28 |
Correct |
1 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
216 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
2 ms |
320 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
324 KB |
Output is correct |
36 |
Correct |
1 ms |
328 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
320 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
6 ms |
724 KB |
Output is correct |
42 |
Correct |
6 ms |
596 KB |
Output is correct |
43 |
Correct |
7 ms |
724 KB |
Output is correct |
44 |
Correct |
7 ms |
724 KB |
Output is correct |
45 |
Correct |
7 ms |
724 KB |
Output is correct |
46 |
Correct |
50 ms |
3540 KB |
Output is correct |
47 |
Correct |
60 ms |
3440 KB |
Output is correct |
48 |
Correct |
54 ms |
3032 KB |
Output is correct |
49 |
Correct |
55 ms |
3032 KB |
Output is correct |
50 |
Correct |
61 ms |
3008 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
324 KB |
Output is correct |
4 |
Correct |
1 ms |
316 KB |
Output is correct |
5 |
Correct |
411 ms |
25100 KB |
Output is correct |
6 |
Correct |
223 ms |
19056 KB |
Output is correct |
7 |
Correct |
533 ms |
21004 KB |
Output is correct |
8 |
Correct |
551 ms |
21060 KB |
Output is correct |
9 |
Correct |
670 ms |
21120 KB |
Output is correct |
10 |
Correct |
505 ms |
21056 KB |
Output is correct |
11 |
Correct |
576 ms |
21040 KB |
Output is correct |
12 |
Correct |
630 ms |
21056 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
320 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
316 KB |
Output is correct |
18 |
Correct |
0 ms |
324 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
324 KB |
Output is correct |
21 |
Correct |
1 ms |
212 KB |
Output is correct |
22 |
Correct |
1 ms |
320 KB |
Output is correct |
23 |
Correct |
1 ms |
212 KB |
Output is correct |
24 |
Correct |
1 ms |
316 KB |
Output is correct |
25 |
Correct |
1 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
1 ms |
316 KB |
Output is correct |
28 |
Correct |
1 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
216 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
2 ms |
320 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
324 KB |
Output is correct |
36 |
Correct |
1 ms |
328 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
320 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
6 ms |
724 KB |
Output is correct |
42 |
Correct |
6 ms |
596 KB |
Output is correct |
43 |
Correct |
7 ms |
724 KB |
Output is correct |
44 |
Correct |
7 ms |
724 KB |
Output is correct |
45 |
Correct |
7 ms |
724 KB |
Output is correct |
46 |
Correct |
50 ms |
3540 KB |
Output is correct |
47 |
Correct |
60 ms |
3440 KB |
Output is correct |
48 |
Correct |
54 ms |
3032 KB |
Output is correct |
49 |
Correct |
55 ms |
3032 KB |
Output is correct |
50 |
Correct |
61 ms |
3008 KB |
Output is correct |
51 |
Correct |
248 ms |
19152 KB |
Output is correct |
52 |
Correct |
536 ms |
25324 KB |
Output is correct |
53 |
Correct |
700 ms |
25312 KB |
Output is correct |
54 |
Correct |
704 ms |
25296 KB |
Output is correct |
55 |
Correct |
1 ms |
340 KB |
Output is correct |
56 |
Correct |
86 ms |
3616 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
320 KB |
Output is correct |
2 |
Correct |
86 ms |
8004 KB |
Output is correct |
3 |
Correct |
82 ms |
8008 KB |
Output is correct |
4 |
Correct |
70 ms |
7440 KB |
Output is correct |
5 |
Correct |
91 ms |
8028 KB |
Output is correct |
6 |
Correct |
50 ms |
7492 KB |
Output is correct |
7 |
Correct |
80 ms |
8012 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
316 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
320 KB |
Output is correct |
2 |
Correct |
86 ms |
8004 KB |
Output is correct |
3 |
Correct |
82 ms |
8008 KB |
Output is correct |
4 |
Correct |
70 ms |
7440 KB |
Output is correct |
5 |
Correct |
91 ms |
8028 KB |
Output is correct |
6 |
Correct |
50 ms |
7492 KB |
Output is correct |
7 |
Correct |
80 ms |
8012 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
316 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
316 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
247 ms |
12768 KB |
Output is correct |
21 |
Correct |
218 ms |
12148 KB |
Output is correct |
22 |
Correct |
189 ms |
12176 KB |
Output is correct |
23 |
Correct |
196 ms |
12788 KB |
Output is correct |
24 |
Correct |
196 ms |
12756 KB |
Output is correct |
25 |
Correct |
225 ms |
12688 KB |
Output is correct |
26 |
Correct |
221 ms |
12748 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
1 ms |
316 KB |
Output is correct |
31 |
Correct |
1 ms |
212 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
212 KB |
Output is correct |
39 |
Correct |
0 ms |
212 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
1 ms |
212 KB |
Output is correct |
43 |
Correct |
1 ms |
212 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
320 KB |
Output is correct |
2 |
Correct |
86 ms |
8004 KB |
Output is correct |
3 |
Correct |
82 ms |
8008 KB |
Output is correct |
4 |
Correct |
70 ms |
7440 KB |
Output is correct |
5 |
Correct |
91 ms |
8028 KB |
Output is correct |
6 |
Correct |
50 ms |
7492 KB |
Output is correct |
7 |
Correct |
80 ms |
8012 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
316 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
316 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
247 ms |
12768 KB |
Output is correct |
21 |
Correct |
218 ms |
12148 KB |
Output is correct |
22 |
Correct |
189 ms |
12176 KB |
Output is correct |
23 |
Correct |
196 ms |
12788 KB |
Output is correct |
24 |
Correct |
196 ms |
12756 KB |
Output is correct |
25 |
Correct |
225 ms |
12688 KB |
Output is correct |
26 |
Correct |
221 ms |
12748 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
1 ms |
316 KB |
Output is correct |
31 |
Correct |
1 ms |
212 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
212 KB |
Output is correct |
39 |
Correct |
0 ms |
212 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
1 ms |
212 KB |
Output is correct |
43 |
Correct |
1 ms |
212 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
2 ms |
340 KB |
Output is correct |
47 |
Correct |
322 ms |
15320 KB |
Output is correct |
48 |
Correct |
301 ms |
14672 KB |
Output is correct |
49 |
Correct |
284 ms |
14552 KB |
Output is correct |
50 |
Correct |
294 ms |
15324 KB |
Output is correct |
51 |
Correct |
210 ms |
15316 KB |
Output is correct |
52 |
Correct |
290 ms |
15336 KB |
Output is correct |
53 |
Correct |
312 ms |
15316 KB |
Output is correct |
54 |
Correct |
6 ms |
724 KB |
Output is correct |
55 |
Correct |
6 ms |
596 KB |
Output is correct |
56 |
Correct |
9 ms |
724 KB |
Output is correct |
57 |
Correct |
8 ms |
724 KB |
Output is correct |
58 |
Correct |
9 ms |
796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
320 KB |
Output is correct |
2 |
Correct |
86 ms |
8004 KB |
Output is correct |
3 |
Correct |
82 ms |
8008 KB |
Output is correct |
4 |
Correct |
70 ms |
7440 KB |
Output is correct |
5 |
Correct |
91 ms |
8028 KB |
Output is correct |
6 |
Correct |
50 ms |
7492 KB |
Output is correct |
7 |
Correct |
80 ms |
8012 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
316 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
340 KB |
Output is correct |
18 |
Correct |
1 ms |
316 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
247 ms |
12768 KB |
Output is correct |
21 |
Correct |
218 ms |
12148 KB |
Output is correct |
22 |
Correct |
189 ms |
12176 KB |
Output is correct |
23 |
Correct |
196 ms |
12788 KB |
Output is correct |
24 |
Correct |
196 ms |
12756 KB |
Output is correct |
25 |
Correct |
225 ms |
12688 KB |
Output is correct |
26 |
Correct |
221 ms |
12748 KB |
Output is correct |
27 |
Correct |
1 ms |
340 KB |
Output is correct |
28 |
Correct |
1 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
1 ms |
316 KB |
Output is correct |
31 |
Correct |
1 ms |
212 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
212 KB |
Output is correct |
39 |
Correct |
0 ms |
212 KB |
Output is correct |
40 |
Correct |
1 ms |
212 KB |
Output is correct |
41 |
Correct |
1 ms |
212 KB |
Output is correct |
42 |
Correct |
1 ms |
212 KB |
Output is correct |
43 |
Correct |
1 ms |
212 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
2 ms |
340 KB |
Output is correct |
47 |
Correct |
322 ms |
15320 KB |
Output is correct |
48 |
Correct |
301 ms |
14672 KB |
Output is correct |
49 |
Correct |
284 ms |
14552 KB |
Output is correct |
50 |
Correct |
294 ms |
15324 KB |
Output is correct |
51 |
Correct |
210 ms |
15316 KB |
Output is correct |
52 |
Correct |
290 ms |
15336 KB |
Output is correct |
53 |
Correct |
312 ms |
15316 KB |
Output is correct |
54 |
Correct |
6 ms |
724 KB |
Output is correct |
55 |
Correct |
6 ms |
596 KB |
Output is correct |
56 |
Correct |
9 ms |
724 KB |
Output is correct |
57 |
Correct |
8 ms |
724 KB |
Output is correct |
58 |
Correct |
9 ms |
796 KB |
Output is correct |
59 |
Correct |
309 ms |
17236 KB |
Output is correct |
60 |
Correct |
169 ms |
8268 KB |
Output is correct |
61 |
Correct |
193 ms |
9624 KB |
Output is correct |
62 |
Correct |
177 ms |
9760 KB |
Output is correct |
63 |
Correct |
359 ms |
17248 KB |
Output is correct |
64 |
Correct |
358 ms |
18908 KB |
Output is correct |
65 |
Correct |
380 ms |
18912 KB |
Output is correct |
66 |
Correct |
251 ms |
18904 KB |
Output is correct |
67 |
Correct |
312 ms |
18892 KB |
Output is correct |
68 |
Correct |
328 ms |
18904 KB |
Output is correct |
69 |
Correct |
385 ms |
18912 KB |
Output is correct |
70 |
Correct |
43 ms |
3540 KB |
Output is correct |
71 |
Correct |
53 ms |
3536 KB |
Output is correct |
72 |
Correct |
54 ms |
3032 KB |
Output is correct |
73 |
Correct |
47 ms |
3016 KB |
Output is correct |
74 |
Correct |
57 ms |
3032 KB |
Output is correct |
75 |
Correct |
66 ms |
3548 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
324 KB |
Output is correct |
4 |
Correct |
1 ms |
316 KB |
Output is correct |
5 |
Correct |
411 ms |
25100 KB |
Output is correct |
6 |
Correct |
223 ms |
19056 KB |
Output is correct |
7 |
Correct |
533 ms |
21004 KB |
Output is correct |
8 |
Correct |
551 ms |
21060 KB |
Output is correct |
9 |
Correct |
670 ms |
21120 KB |
Output is correct |
10 |
Correct |
505 ms |
21056 KB |
Output is correct |
11 |
Correct |
576 ms |
21040 KB |
Output is correct |
12 |
Correct |
630 ms |
21056 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
320 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
316 KB |
Output is correct |
18 |
Correct |
0 ms |
324 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
324 KB |
Output is correct |
21 |
Correct |
1 ms |
212 KB |
Output is correct |
22 |
Correct |
1 ms |
320 KB |
Output is correct |
23 |
Correct |
1 ms |
212 KB |
Output is correct |
24 |
Correct |
1 ms |
316 KB |
Output is correct |
25 |
Correct |
1 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
1 ms |
316 KB |
Output is correct |
28 |
Correct |
1 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
216 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
2 ms |
320 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
324 KB |
Output is correct |
36 |
Correct |
1 ms |
328 KB |
Output is correct |
37 |
Correct |
1 ms |
212 KB |
Output is correct |
38 |
Correct |
1 ms |
320 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Correct |
6 ms |
724 KB |
Output is correct |
42 |
Correct |
6 ms |
596 KB |
Output is correct |
43 |
Correct |
7 ms |
724 KB |
Output is correct |
44 |
Correct |
7 ms |
724 KB |
Output is correct |
45 |
Correct |
7 ms |
724 KB |
Output is correct |
46 |
Correct |
50 ms |
3540 KB |
Output is correct |
47 |
Correct |
60 ms |
3440 KB |
Output is correct |
48 |
Correct |
54 ms |
3032 KB |
Output is correct |
49 |
Correct |
55 ms |
3032 KB |
Output is correct |
50 |
Correct |
61 ms |
3008 KB |
Output is correct |
51 |
Correct |
248 ms |
19152 KB |
Output is correct |
52 |
Correct |
536 ms |
25324 KB |
Output is correct |
53 |
Correct |
700 ms |
25312 KB |
Output is correct |
54 |
Correct |
704 ms |
25296 KB |
Output is correct |
55 |
Correct |
1 ms |
340 KB |
Output is correct |
56 |
Correct |
86 ms |
3616 KB |
Output is correct |
57 |
Correct |
1 ms |
320 KB |
Output is correct |
58 |
Correct |
86 ms |
8004 KB |
Output is correct |
59 |
Correct |
82 ms |
8008 KB |
Output is correct |
60 |
Correct |
70 ms |
7440 KB |
Output is correct |
61 |
Correct |
91 ms |
8028 KB |
Output is correct |
62 |
Correct |
50 ms |
7492 KB |
Output is correct |
63 |
Correct |
80 ms |
8012 KB |
Output is correct |
64 |
Correct |
1 ms |
212 KB |
Output is correct |
65 |
Correct |
1 ms |
316 KB |
Output is correct |
66 |
Correct |
1 ms |
212 KB |
Output is correct |
67 |
Correct |
0 ms |
212 KB |
Output is correct |
68 |
Correct |
1 ms |
212 KB |
Output is correct |
69 |
Correct |
1 ms |
212 KB |
Output is correct |
70 |
Correct |
1 ms |
212 KB |
Output is correct |
71 |
Correct |
1 ms |
212 KB |
Output is correct |
72 |
Correct |
1 ms |
212 KB |
Output is correct |
73 |
Correct |
1 ms |
340 KB |
Output is correct |
74 |
Correct |
1 ms |
316 KB |
Output is correct |
75 |
Correct |
1 ms |
212 KB |
Output is correct |
76 |
Correct |
247 ms |
12768 KB |
Output is correct |
77 |
Correct |
218 ms |
12148 KB |
Output is correct |
78 |
Correct |
189 ms |
12176 KB |
Output is correct |
79 |
Correct |
196 ms |
12788 KB |
Output is correct |
80 |
Correct |
196 ms |
12756 KB |
Output is correct |
81 |
Correct |
225 ms |
12688 KB |
Output is correct |
82 |
Correct |
221 ms |
12748 KB |
Output is correct |
83 |
Correct |
1 ms |
340 KB |
Output is correct |
84 |
Correct |
1 ms |
212 KB |
Output is correct |
85 |
Correct |
1 ms |
212 KB |
Output is correct |
86 |
Correct |
1 ms |
316 KB |
Output is correct |
87 |
Correct |
1 ms |
212 KB |
Output is correct |
88 |
Correct |
1 ms |
212 KB |
Output is correct |
89 |
Correct |
1 ms |
212 KB |
Output is correct |
90 |
Correct |
1 ms |
212 KB |
Output is correct |
91 |
Correct |
1 ms |
340 KB |
Output is correct |
92 |
Correct |
1 ms |
340 KB |
Output is correct |
93 |
Correct |
1 ms |
212 KB |
Output is correct |
94 |
Correct |
1 ms |
212 KB |
Output is correct |
95 |
Correct |
0 ms |
212 KB |
Output is correct |
96 |
Correct |
1 ms |
212 KB |
Output is correct |
97 |
Correct |
1 ms |
212 KB |
Output is correct |
98 |
Correct |
1 ms |
212 KB |
Output is correct |
99 |
Correct |
1 ms |
212 KB |
Output is correct |
100 |
Correct |
1 ms |
340 KB |
Output is correct |
101 |
Correct |
1 ms |
340 KB |
Output is correct |
102 |
Correct |
2 ms |
340 KB |
Output is correct |
103 |
Correct |
322 ms |
15320 KB |
Output is correct |
104 |
Correct |
301 ms |
14672 KB |
Output is correct |
105 |
Correct |
284 ms |
14552 KB |
Output is correct |
106 |
Correct |
294 ms |
15324 KB |
Output is correct |
107 |
Correct |
210 ms |
15316 KB |
Output is correct |
108 |
Correct |
290 ms |
15336 KB |
Output is correct |
109 |
Correct |
312 ms |
15316 KB |
Output is correct |
110 |
Correct |
6 ms |
724 KB |
Output is correct |
111 |
Correct |
6 ms |
596 KB |
Output is correct |
112 |
Correct |
9 ms |
724 KB |
Output is correct |
113 |
Correct |
8 ms |
724 KB |
Output is correct |
114 |
Correct |
9 ms |
796 KB |
Output is correct |
115 |
Correct |
309 ms |
17236 KB |
Output is correct |
116 |
Correct |
169 ms |
8268 KB |
Output is correct |
117 |
Correct |
193 ms |
9624 KB |
Output is correct |
118 |
Correct |
177 ms |
9760 KB |
Output is correct |
119 |
Correct |
359 ms |
17248 KB |
Output is correct |
120 |
Correct |
358 ms |
18908 KB |
Output is correct |
121 |
Correct |
380 ms |
18912 KB |
Output is correct |
122 |
Correct |
251 ms |
18904 KB |
Output is correct |
123 |
Correct |
312 ms |
18892 KB |
Output is correct |
124 |
Correct |
328 ms |
18904 KB |
Output is correct |
125 |
Correct |
385 ms |
18912 KB |
Output is correct |
126 |
Correct |
43 ms |
3540 KB |
Output is correct |
127 |
Correct |
53 ms |
3536 KB |
Output is correct |
128 |
Correct |
54 ms |
3032 KB |
Output is correct |
129 |
Correct |
47 ms |
3016 KB |
Output is correct |
130 |
Correct |
57 ms |
3032 KB |
Output is correct |
131 |
Correct |
66 ms |
3548 KB |
Output is correct |
132 |
Correct |
854 ms |
39308 KB |
Output is correct |
133 |
Correct |
869 ms |
39308 KB |
Output is correct |
134 |
Correct |
879 ms |
39344 KB |
Output is correct |
135 |
Correct |
781 ms |
39284 KB |
Output is correct |
136 |
Correct |
1002 ms |
39252 KB |
Output is correct |
137 |
Correct |
595 ms |
26324 KB |
Output is correct |
138 |
Correct |
583 ms |
26268 KB |
Output is correct |
139 |
Correct |
493 ms |
35164 KB |
Output is correct |
140 |
Correct |
707 ms |
39320 KB |
Output is correct |
141 |
Correct |
943 ms |
39236 KB |
Output is correct |
142 |
Correct |
1043 ms |
39236 KB |
Output is correct |