답안 #982409

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
982409 2024-05-14T08:16:44 Z vjudge1 벽 칠하기 (APIO20_paint) C++17
51 / 100
1500 ms 57068 KB
#include "paint.h"
#include <bits/stdc++.h>
 
#pragma optimize("Ofast")
#pragma target("avx2")
 
using namespace std;
 
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define pii pair<int,int>
#define all(v) v.begin(),v.end()
#define F first
#define S second
#define mem(a,i) memset(a,i,sizeof(a))
#define sz(s) (int)s.size()
#define y1 yy
#define ppb pop_back
#define lb lower_bound
#define ub upper_bound
#define gcd(a,b) __gcd(a,b)
#define in insert
// #define int ll

const int MAX=1e5+15;
const int B=300;
const int N=104;
const int block=400;
const int maxB=MAX/B+10;
const ll inf=2e9;  
const int mod=998244353;
const int mod1=1e9+9;
const ld eps=1e-9;
 
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,-1,1,-1};
 
int binpow(int a,int n){
  if(!n)return 1;
  if(n%2==1)return a*binpow(a,n-1)%mod;
  int k=binpow(a,n/2);
  return k*k%mod;
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int good[MAX];
int cnt[MAX];
int n,m;
vector<int> c;
vector<int> g[MAX],G[MAX];
int f;

void add(int i){
  for(int x:g[i]){
    cnt[x]++;
    if(cnt[x]==m)f++;
    // cout<<i<<" "<<x<<"\n";
  }
}

void del(int i){
  for(int x:g[i]){
    if(cnt[x]==m)f--;
    cnt[x]--;
  }
}

int dp[MAX];

struct segtree{

  int t[4*MAX];

  void build(int v,int tl,int tr){
    t[v]=inf;
    if(tl==tr){
      return;
    }
    int tm=(tl+tr)/2;
    build(2*v,tl,tm);
    build(2*v+1,tm+1,tr);
  }

  void update(int v,int tl,int tr,int pos,int x){
    if(tl==tr){
      t[v]=x;
      return;
    }
    int tm=(tl+tr)/2;
    if(pos<=tm)update(2*v,tl,tm,pos,x);
    else update(2*v+1,tm+1,tr,pos,x);
    t[v]=min(t[2*v],t[2*v+1]);
  }

  int get(int v,int tl,int tr,int l,int r){
    if(l>r||tl>r||l>tr)return inf;
    if(l<=tl&&tr<=r)return t[v];
    int tm=(tl+tr)/2;
    return min(get(2*v,tl,tm,l,r),get(2*v+1,tm+1,tr,l,r));
  }
}t;

int minimumInstructions(int N, int M, int K, vector<int> C,vector<int> A, vector<vector<int>> B) {
  n=N;
  m=M;
  c=C;
  // cerr<<"OK\n";
  for(int i=0;i<M;i++){
    for(int x:B[i]){
      G[x].pb(i);
    }
  }
  for(int i=0;i<N;i++){
    g[i]=G[C[i]];
    // cout<<"!!! "<<i<<"\n";
    for(int j=0;j<sz(g[i]);j++){
      g[i][j]-=i;
      while(g[i][j]<0)g[i][j]+=M;
      // cout<<g[i][j]<<" ";
    }
    // cout<<"\n";
  }
  for(int i=0;i<M;i++)add(i);
  if(f)good[M-1]=1;
  // cout<<good[M-1]<<"\n";
  // return -1;
  for(int i=M;i<N;i++){
    del(i-M);
    add(i);
    if(f)good[i]=1;
    // cout<<i<<" "<<good[i]<<"\n";
  }
  if(!good[M-1])return -1;
  t.build(1,0,N-1);
  // for(int i=0;i<N;i++){
  //   cout<<t.get(1,0,N-1,i,i)<<"\n";
  // }
  t.update(1,0,N-1,M-1,1);
  for(int i=M;i<N;i++){
    if(good[i]){
      t.update(1,0,N-1,i,t.get(1,0,N-1,i-M,i-1)+1);
    }
  }
  return (t.get(1,0,N-1,N-1,N-1)==inf?-1:t.get(1,0,N-1,N-1,N-1));
}

Compilation message

paint.cpp:4: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    4 | #pragma optimize("Ofast")
      | 
paint.cpp:5: warning: ignoring '#pragma target ' [-Wunknown-pragmas]
    5 | #pragma target("avx2")
      |
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6744 KB Output is correct
2 Correct 2 ms 6744 KB Output is correct
3 Correct 1 ms 6748 KB Output is correct
4 Correct 1 ms 6748 KB Output is correct
5 Correct 1 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 2 ms 6748 KB Output is correct
8 Correct 2 ms 6748 KB Output is correct
9 Correct 1 ms 6748 KB Output is correct
10 Correct 2 ms 6748 KB Output is correct
11 Correct 2 ms 6748 KB Output is correct
12 Correct 1 ms 6748 KB Output is correct
13 Correct 2 ms 6744 KB Output is correct
14 Correct 2 ms 6744 KB Output is correct
15 Correct 2 ms 6748 KB Output is correct
16 Correct 2 ms 6748 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6748 KB Output is correct
19 Correct 2 ms 6748 KB Output is correct
20 Correct 1 ms 6748 KB Output is correct
21 Correct 2 ms 6748 KB Output is correct
22 Correct 13 ms 10844 KB Output is correct
23 Correct 17 ms 10844 KB Output is correct
24 Correct 18 ms 10868 KB Output is correct
25 Correct 78 ms 7964 KB Output is correct
26 Correct 97 ms 7836 KB Output is correct
27 Correct 41 ms 7760 KB Output is correct
28 Correct 25 ms 7764 KB Output is correct
29 Correct 20 ms 7772 KB Output is correct
30 Correct 16 ms 7752 KB Output is correct
31 Correct 11 ms 8792 KB Output is correct
32 Correct 11 ms 8792 KB Output is correct
33 Correct 11 ms 8956 KB Output is correct
34 Correct 11 ms 8792 KB Output is correct
35 Correct 12 ms 8796 KB Output is correct
36 Correct 12 ms 8888 KB Output is correct
37 Correct 18 ms 11808 KB Output is correct
38 Correct 23 ms 11868 KB Output is correct
39 Correct 18 ms 11868 KB Output is correct
40 Correct 1362 ms 11608 KB Output is correct
41 Correct 525 ms 9596 KB Output is correct
42 Correct 778 ms 11652 KB Output is correct
43 Correct 228 ms 9852 KB Output is correct
44 Correct 162 ms 9756 KB Output is correct
45 Correct 320 ms 11344 KB Output is correct
46 Correct 42 ms 19280 KB Output is correct
47 Correct 27 ms 14172 KB Output is correct
48 Correct 26 ms 16464 KB Output is correct
49 Correct 28 ms 16880 KB Output is correct
50 Correct 29 ms 16984 KB Output is correct
51 Correct 24 ms 14624 KB Output is correct
52 Execution timed out 1540 ms 11200 KB Time limit exceeded
53 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6744 KB Output is correct
2 Correct 2 ms 6744 KB Output is correct
3 Correct 1 ms 6748 KB Output is correct
4 Correct 1 ms 6748 KB Output is correct
5 Correct 1 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 2 ms 6748 KB Output is correct
8 Correct 2 ms 6748 KB Output is correct
9 Correct 1 ms 6748 KB Output is correct
10 Correct 2 ms 6748 KB Output is correct
11 Correct 2 ms 6748 KB Output is correct
12 Correct 1 ms 6748 KB Output is correct
13 Correct 2 ms 6744 KB Output is correct
14 Correct 2 ms 6744 KB Output is correct
15 Correct 2 ms 6748 KB Output is correct
16 Correct 2 ms 6748 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6748 KB Output is correct
19 Correct 2 ms 6748 KB Output is correct
20 Correct 1 ms 6748 KB Output is correct
21 Correct 2 ms 6748 KB Output is correct
22 Correct 1 ms 6748 KB Output is correct
23 Correct 1 ms 6748 KB Output is correct
24 Correct 1 ms 6748 KB Output is correct
25 Correct 2 ms 6748 KB Output is correct
26 Correct 1 ms 6744 KB Output is correct
27 Correct 1 ms 6748 KB Output is correct
28 Correct 2 ms 6748 KB Output is correct
29 Correct 1 ms 6748 KB Output is correct
30 Correct 2 ms 6744 KB Output is correct
31 Correct 2 ms 6744 KB Output is correct
32 Correct 2 ms 6748 KB Output is correct
33 Correct 2 ms 6748 KB Output is correct
34 Correct 2 ms 6748 KB Output is correct
35 Correct 2 ms 6748 KB Output is correct
36 Correct 1 ms 6748 KB Output is correct
37 Correct 2 ms 6984 KB Output is correct
38 Correct 2 ms 6748 KB Output is correct
39 Correct 2 ms 6748 KB Output is correct
40 Correct 2 ms 6748 KB Output is correct
41 Correct 2 ms 6788 KB Output is correct
42 Correct 2 ms 6744 KB Output is correct
43 Correct 2 ms 6748 KB Output is correct
44 Correct 2 ms 6748 KB Output is correct
45 Correct 2 ms 7000 KB Output is correct
46 Correct 2 ms 6748 KB Output is correct
47 Correct 2 ms 6748 KB Output is correct
48 Correct 2 ms 6748 KB Output is correct
49 Correct 1 ms 6748 KB Output is correct
50 Correct 2 ms 6748 KB Output is correct
51 Correct 2 ms 6748 KB Output is correct
52 Correct 2 ms 6748 KB Output is correct
53 Correct 2 ms 6748 KB Output is correct
54 Correct 2 ms 6748 KB Output is correct
55 Correct 2 ms 6748 KB Output is correct
56 Correct 2 ms 6748 KB Output is correct
57 Correct 2 ms 6744 KB Output is correct
58 Correct 2 ms 6748 KB Output is correct
59 Correct 2 ms 6748 KB Output is correct
60 Correct 2 ms 6744 KB Output is correct
61 Correct 2 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 6748 KB Output is correct
2 Correct 1 ms 6748 KB Output is correct
3 Correct 2 ms 6744 KB Output is correct
4 Correct 2 ms 6744 KB Output is correct
5 Correct 1 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 1 ms 6748 KB Output is correct
8 Correct 1 ms 6748 KB Output is correct
9 Correct 2 ms 6748 KB Output is correct
10 Correct 2 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
12 Correct 2 ms 6748 KB Output is correct
13 Correct 2 ms 6748 KB Output is correct
14 Correct 1 ms 6748 KB Output is correct
15 Correct 2 ms 6744 KB Output is correct
16 Correct 2 ms 6744 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6748 KB Output is correct
19 Correct 2 ms 6748 KB Output is correct
20 Correct 2 ms 6748 KB Output is correct
21 Correct 2 ms 6748 KB Output is correct
22 Correct 1 ms 6748 KB Output is correct
23 Correct 2 ms 6748 KB Output is correct
24 Correct 13 ms 10844 KB Output is correct
25 Correct 17 ms 10844 KB Output is correct
26 Correct 18 ms 10868 KB Output is correct
27 Correct 1 ms 6748 KB Output is correct
28 Correct 2 ms 6748 KB Output is correct
29 Correct 1 ms 6744 KB Output is correct
30 Correct 1 ms 6748 KB Output is correct
31 Correct 2 ms 6748 KB Output is correct
32 Correct 1 ms 6748 KB Output is correct
33 Correct 2 ms 6744 KB Output is correct
34 Correct 2 ms 6744 KB Output is correct
35 Correct 2 ms 6748 KB Output is correct
36 Correct 2 ms 6748 KB Output is correct
37 Correct 2 ms 6748 KB Output is correct
38 Correct 2 ms 6748 KB Output is correct
39 Correct 1 ms 6748 KB Output is correct
40 Correct 2 ms 6984 KB Output is correct
41 Correct 2 ms 6748 KB Output is correct
42 Correct 2 ms 6748 KB Output is correct
43 Correct 2 ms 6748 KB Output is correct
44 Correct 2 ms 6788 KB Output is correct
45 Correct 2 ms 6744 KB Output is correct
46 Correct 2 ms 6748 KB Output is correct
47 Correct 2 ms 6748 KB Output is correct
48 Correct 2 ms 7000 KB Output is correct
49 Correct 2 ms 6748 KB Output is correct
50 Correct 2 ms 6748 KB Output is correct
51 Correct 2 ms 6748 KB Output is correct
52 Correct 1 ms 6748 KB Output is correct
53 Correct 2 ms 6748 KB Output is correct
54 Correct 2 ms 6748 KB Output is correct
55 Correct 2 ms 6748 KB Output is correct
56 Correct 2 ms 6748 KB Output is correct
57 Correct 2 ms 6748 KB Output is correct
58 Correct 2 ms 6748 KB Output is correct
59 Correct 2 ms 6748 KB Output is correct
60 Correct 2 ms 6744 KB Output is correct
61 Correct 2 ms 6748 KB Output is correct
62 Correct 2 ms 6748 KB Output is correct
63 Correct 2 ms 6744 KB Output is correct
64 Correct 2 ms 6748 KB Output is correct
65 Correct 2 ms 7000 KB Output is correct
66 Correct 2 ms 7004 KB Output is correct
67 Correct 2 ms 7184 KB Output is correct
68 Correct 3 ms 7004 KB Output is correct
69 Correct 2 ms 7000 KB Output is correct
70 Correct 3 ms 7004 KB Output is correct
71 Correct 3 ms 7048 KB Output is correct
72 Correct 3 ms 7004 KB Output is correct
73 Correct 2 ms 7004 KB Output is correct
74 Correct 3 ms 7004 KB Output is correct
75 Correct 2 ms 7256 KB Output is correct
76 Correct 14 ms 9564 KB Output is correct
77 Correct 15 ms 9820 KB Output is correct
78 Correct 17 ms 10308 KB Output is correct
79 Correct 2 ms 7260 KB Output is correct
80 Correct 2 ms 7260 KB Output is correct
81 Correct 2 ms 7256 KB Output is correct
82 Correct 2 ms 7260 KB Output is correct
83 Correct 2 ms 7260 KB Output is correct
84 Correct 3 ms 7004 KB Output is correct
85 Correct 3 ms 7004 KB Output is correct
86 Correct 3 ms 7004 KB Output is correct
87 Correct 3 ms 7000 KB Output is correct
88 Correct 3 ms 7000 KB Output is correct
89 Correct 3 ms 7004 KB Output is correct
90 Correct 19 ms 10588 KB Output is correct
91 Correct 21 ms 10532 KB Output is correct
92 Correct 21 ms 10588 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 6748 KB Output is correct
2 Correct 1 ms 6748 KB Output is correct
3 Correct 2 ms 6744 KB Output is correct
4 Correct 2 ms 6744 KB Output is correct
5 Correct 1 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 1 ms 6748 KB Output is correct
8 Correct 1 ms 6748 KB Output is correct
9 Correct 2 ms 6748 KB Output is correct
10 Correct 2 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
12 Correct 2 ms 6748 KB Output is correct
13 Correct 2 ms 6748 KB Output is correct
14 Correct 1 ms 6748 KB Output is correct
15 Correct 2 ms 6744 KB Output is correct
16 Correct 2 ms 6744 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6748 KB Output is correct
19 Correct 2 ms 6748 KB Output is correct
20 Correct 2 ms 6748 KB Output is correct
21 Correct 2 ms 6748 KB Output is correct
22 Correct 1 ms 6748 KB Output is correct
23 Correct 2 ms 6748 KB Output is correct
24 Correct 13 ms 10844 KB Output is correct
25 Correct 17 ms 10844 KB Output is correct
26 Correct 18 ms 10868 KB Output is correct
27 Correct 78 ms 7964 KB Output is correct
28 Correct 97 ms 7836 KB Output is correct
29 Correct 41 ms 7760 KB Output is correct
30 Correct 25 ms 7764 KB Output is correct
31 Correct 20 ms 7772 KB Output is correct
32 Correct 16 ms 7752 KB Output is correct
33 Correct 11 ms 8792 KB Output is correct
34 Correct 11 ms 8792 KB Output is correct
35 Correct 11 ms 8956 KB Output is correct
36 Correct 11 ms 8792 KB Output is correct
37 Correct 12 ms 8796 KB Output is correct
38 Correct 12 ms 8888 KB Output is correct
39 Correct 18 ms 11808 KB Output is correct
40 Correct 23 ms 11868 KB Output is correct
41 Correct 18 ms 11868 KB Output is correct
42 Correct 1 ms 6748 KB Output is correct
43 Correct 2 ms 6748 KB Output is correct
44 Correct 1 ms 6744 KB Output is correct
45 Correct 1 ms 6748 KB Output is correct
46 Correct 2 ms 6748 KB Output is correct
47 Correct 1 ms 6748 KB Output is correct
48 Correct 2 ms 6744 KB Output is correct
49 Correct 2 ms 6744 KB Output is correct
50 Correct 2 ms 6748 KB Output is correct
51 Correct 2 ms 6748 KB Output is correct
52 Correct 2 ms 6748 KB Output is correct
53 Correct 2 ms 6748 KB Output is correct
54 Correct 1 ms 6748 KB Output is correct
55 Correct 2 ms 6984 KB Output is correct
56 Correct 2 ms 6748 KB Output is correct
57 Correct 2 ms 6748 KB Output is correct
58 Correct 2 ms 6748 KB Output is correct
59 Correct 2 ms 6788 KB Output is correct
60 Correct 2 ms 6744 KB Output is correct
61 Correct 2 ms 6748 KB Output is correct
62 Correct 2 ms 6748 KB Output is correct
63 Correct 2 ms 7000 KB Output is correct
64 Correct 2 ms 6748 KB Output is correct
65 Correct 2 ms 6748 KB Output is correct
66 Correct 2 ms 6748 KB Output is correct
67 Correct 1 ms 6748 KB Output is correct
68 Correct 2 ms 6748 KB Output is correct
69 Correct 2 ms 6748 KB Output is correct
70 Correct 2 ms 6748 KB Output is correct
71 Correct 2 ms 6748 KB Output is correct
72 Correct 2 ms 6748 KB Output is correct
73 Correct 2 ms 6748 KB Output is correct
74 Correct 2 ms 6748 KB Output is correct
75 Correct 2 ms 6744 KB Output is correct
76 Correct 2 ms 6748 KB Output is correct
77 Correct 2 ms 6748 KB Output is correct
78 Correct 2 ms 6744 KB Output is correct
79 Correct 2 ms 6748 KB Output is correct
80 Correct 2 ms 7000 KB Output is correct
81 Correct 2 ms 7004 KB Output is correct
82 Correct 2 ms 7184 KB Output is correct
83 Correct 3 ms 7004 KB Output is correct
84 Correct 2 ms 7000 KB Output is correct
85 Correct 3 ms 7004 KB Output is correct
86 Correct 3 ms 7048 KB Output is correct
87 Correct 3 ms 7004 KB Output is correct
88 Correct 2 ms 7004 KB Output is correct
89 Correct 3 ms 7004 KB Output is correct
90 Correct 2 ms 7256 KB Output is correct
91 Correct 14 ms 9564 KB Output is correct
92 Correct 15 ms 9820 KB Output is correct
93 Correct 17 ms 10308 KB Output is correct
94 Correct 2 ms 7260 KB Output is correct
95 Correct 2 ms 7260 KB Output is correct
96 Correct 2 ms 7256 KB Output is correct
97 Correct 2 ms 7260 KB Output is correct
98 Correct 2 ms 7260 KB Output is correct
99 Correct 3 ms 7004 KB Output is correct
100 Correct 3 ms 7004 KB Output is correct
101 Correct 3 ms 7004 KB Output is correct
102 Correct 3 ms 7000 KB Output is correct
103 Correct 3 ms 7000 KB Output is correct
104 Correct 3 ms 7004 KB Output is correct
105 Correct 19 ms 10588 KB Output is correct
106 Correct 21 ms 10532 KB Output is correct
107 Correct 21 ms 10588 KB Output is correct
108 Correct 68 ms 7760 KB Output is correct
109 Correct 134 ms 42392 KB Output is correct
110 Correct 52 ms 26192 KB Output is correct
111 Correct 39 ms 21084 KB Output is correct
112 Correct 48 ms 23376 KB Output is correct
113 Correct 19 ms 18012 KB Output is correct
114 Correct 12 ms 8936 KB Output is correct
115 Correct 13 ms 8796 KB Output is correct
116 Correct 16 ms 9816 KB Output is correct
117 Correct 13 ms 8796 KB Output is correct
118 Correct 15 ms 9052 KB Output is correct
119 Correct 12 ms 8796 KB Output is correct
120 Correct 15 ms 10072 KB Output is correct
121 Correct 8 ms 8284 KB Output is correct
122 Correct 18 ms 10588 KB Output is correct
123 Correct 7 ms 8028 KB Output is correct
124 Correct 21 ms 11356 KB Output is correct
125 Correct 11 ms 8708 KB Output is correct
126 Correct 10 ms 8540 KB Output is correct
127 Correct 8 ms 9076 KB Output is correct
128 Correct 6 ms 8284 KB Output is correct
129 Correct 7 ms 8540 KB Output is correct
130 Correct 69 ms 8020 KB Output is correct
131 Correct 194 ms 57068 KB Output is correct
132 Correct 104 ms 42324 KB Output is correct
133 Correct 82 ms 35908 KB Output is correct
134 Correct 70 ms 32080 KB Output is correct
135 Correct 46 ms 29520 KB Output is correct
136 Correct 18 ms 10008 KB Output is correct
137 Correct 21 ms 9816 KB Output is correct
138 Correct 22 ms 9932 KB Output is correct
139 Correct 18 ms 9820 KB Output is correct
140 Correct 17 ms 9820 KB Output is correct
141 Correct 17 ms 9820 KB Output is correct
142 Correct 32 ms 12372 KB Output is correct
143 Correct 12 ms 8796 KB Output is correct
144 Correct 25 ms 12380 KB Output is correct
145 Correct 12 ms 8796 KB Output is correct
146 Correct 25 ms 12380 KB Output is correct
147 Correct 11 ms 8792 KB Output is correct
148 Correct 10 ms 9304 KB Output is correct
149 Correct 8 ms 9048 KB Output is correct
150 Correct 9 ms 9052 KB Output is correct
151 Correct 9 ms 9048 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 6748 KB Output is correct
2 Correct 1 ms 6748 KB Output is correct
3 Correct 2 ms 6744 KB Output is correct
4 Correct 2 ms 6744 KB Output is correct
5 Correct 1 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 1 ms 6748 KB Output is correct
8 Correct 1 ms 6748 KB Output is correct
9 Correct 2 ms 6748 KB Output is correct
10 Correct 2 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
12 Correct 2 ms 6748 KB Output is correct
13 Correct 2 ms 6748 KB Output is correct
14 Correct 1 ms 6748 KB Output is correct
15 Correct 2 ms 6744 KB Output is correct
16 Correct 2 ms 6744 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6748 KB Output is correct
19 Correct 2 ms 6748 KB Output is correct
20 Correct 2 ms 6748 KB Output is correct
21 Correct 2 ms 6748 KB Output is correct
22 Correct 1 ms 6748 KB Output is correct
23 Correct 2 ms 6748 KB Output is correct
24 Correct 13 ms 10844 KB Output is correct
25 Correct 17 ms 10844 KB Output is correct
26 Correct 18 ms 10868 KB Output is correct
27 Correct 78 ms 7964 KB Output is correct
28 Correct 97 ms 7836 KB Output is correct
29 Correct 41 ms 7760 KB Output is correct
30 Correct 25 ms 7764 KB Output is correct
31 Correct 20 ms 7772 KB Output is correct
32 Correct 16 ms 7752 KB Output is correct
33 Correct 11 ms 8792 KB Output is correct
34 Correct 11 ms 8792 KB Output is correct
35 Correct 11 ms 8956 KB Output is correct
36 Correct 11 ms 8792 KB Output is correct
37 Correct 12 ms 8796 KB Output is correct
38 Correct 12 ms 8888 KB Output is correct
39 Correct 18 ms 11808 KB Output is correct
40 Correct 23 ms 11868 KB Output is correct
41 Correct 18 ms 11868 KB Output is correct
42 Correct 1362 ms 11608 KB Output is correct
43 Correct 525 ms 9596 KB Output is correct
44 Correct 778 ms 11652 KB Output is correct
45 Correct 228 ms 9852 KB Output is correct
46 Correct 162 ms 9756 KB Output is correct
47 Correct 320 ms 11344 KB Output is correct
48 Correct 42 ms 19280 KB Output is correct
49 Correct 27 ms 14172 KB Output is correct
50 Correct 26 ms 16464 KB Output is correct
51 Correct 28 ms 16880 KB Output is correct
52 Correct 29 ms 16984 KB Output is correct
53 Correct 24 ms 14624 KB Output is correct
54 Execution timed out 1540 ms 11200 KB Time limit exceeded
55 Halted 0 ms 0 KB -