Submission #676956

# Submission time Handle Problem Language Result Execution time Memory
676956 2023-01-01T18:17:32 Z MohammadAghil Painting Walls (APIO20_paint) C++17
100 / 100
586 ms 18964 KB
      #include <bits/stdc++.h>
#include "paint.h"
//   #pragma GCC optimize ("Ofast,unroll-loops")
// #pragma GCC target ("avx2")
 using namespace std;
  typedef long long ll;
   typedef pair<int, int> pp;
     #define per(i,r,l) for(int i = (r); i >= (l); i--)
       #define rep(i,l,r) for(int i = (l); i < (r); i++)
          #define all(x) begin(x), end(x)
             #define sz(x) (int)(x).size()
                 #define pb push_back
                     #define ss second
                          #define ff first
                                  void err(istringstream *iss){}template<typename T,typename ...Args> void err(istringstream *iss,const T &_val, const Args&...args){string _name;*iss>>_name;if(_name.back()==',')_name.pop_back();cerr<<_name<<" = "<<_val<<", ",err(iss,args...);}
void IOS(){
     cin.tie(0) -> sync_with_stdio(0);
     #ifndef ONLINE_JUDGE
          #define er(args ...) cerr << __LINE__ << ": ", err(new istringstream(string(#args)), args), cerr << endl
     #else
          #define er(args ...) 0
     #endif
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll mod = 1e9 + 7, maxn = 3e5 + 5, lg = 22, inf = ll(1e9) + 5;
ll pw(ll a,ll b,ll md=mod){if(!b)return 1;ll k=pw(a,b>>1ll,md);return k*k%md*(b&1ll?a:1)%md;}

int vl[maxn], m, c[maxn];
vector<int> lik[maxn];

int add(int x, int y){
     x += y;
     if(x >= m) x -= m;
     return x;
}
int rem(int x, int y){
     x -= y;
     if(x < 0) x += m;
     return x;
}

int minimumInstructions(int n, int m, int k, vector<int> c, vector<int> a, vector<vector<int>> b){
     ::m = m;
     rep(i,0,m){
          rep(j,0,a[i]){
               lik[b[i][j]].pb(i);
          }
     }
     int bs = 0, cntm = 0;

     auto upd = [&](int p, int k){
          cntm -= vl[p] == m;
          vl[p] += k;
          cntm += vl[p] == m;
     };

     rep(i,0,m){
          for(int x: lik[c[i]]){
               upd(rem(x, i), 1);
          }
     }

     int lst = -1, mx = -1, ans = 0;
     rep(i,0,n-m+1){
          if(cntm) mx = i + m - 1;
          if(i > lst){
               lst = mx;
               ans++;
               if(i > lst){
                    return -1;
               }
          }
          if(i == n - m) break;
          for(int x: lik[c[i]]){
               upd(add(bs, x), -1);
          }
          for(int x: lik[c[i + m]]){
               upd(add(bs, x), 1);
          }
          bs = rem(bs, 1);
     }
     if(lst - n + 1) {
          if(mx == n-1) ans++;
          else {
               return -1;
          }
     }
     return ans;
}

// int main(){ IOS();
//      int n, k; cin >> n >> m >> k;
//      rep(i,0,n){
//           cin >> c[i];
//      }
//      rep(i,0,m){
//           int a; cin >> a;
//           rep(j,0,a){
//                int cl; cin >> cl;
//                lik[cl].pb(i);
//           }
//      }
//      int bs = 0, cntm = 0;

//      auto upd = [&](int p, int k){
//           cntm -= vl[p] == m;
//           vl[p] += k;
//           cntm += vl[p] == m;
//      };

//      rep(i,0,m){
//           for(int x: lik[c[i]]){
//                // er(c[i], i, x);
//                upd(rem(x, i), 1);
//           }
//      }

//      int lst = -1, mx = -1, ans = 0;
//      rep(i,0,n-m+1){
//           // er(i, cntm);
//           rep(i,0,m) cerr << vl[add(bs, i)] << ' ';
//           cerr << endl; 
//           if(cntm) mx = i + m - 1;
//           if(i > lst){
//                lst = mx;
//                ans++;
//                if(i > lst){
//                     cout << -1 << '\n';
//                     return 0;
//                }
//           }
//           if(i == n - m) break;
//           for(int x: lik[c[i]]){
//                upd(add(bs, x), -1);
//           }
//           for(int x: lik[c[i + m]]){
//                upd(add(bs, x), 1);
//           }
//           bs = rem(bs, 1);
//      }
//      if(lst - n + 1) {
//           if(mx == n-1) ans++;
//           else {
//                cout << -1 << '\n';
//                return 0;
//           }
//      }
//      cout << ans << '\n';
//      return 0-0;
// }

/*
5 4 4
1 0 1 2 2
2 0 1
1 1
1 2
1 3

8 3 5
3 3 1 3 4 4 2 2
3 0 1 2
2 2 3
2 3 4
*/
# Verdict Execution time Memory Grader output
1 Correct 4 ms 7252 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 4 ms 7252 KB Output is correct
4 Correct 4 ms 7308 KB Output is correct
5 Correct 4 ms 7360 KB Output is correct
6 Correct 4 ms 7336 KB Output is correct
7 Correct 4 ms 7356 KB Output is correct
8 Correct 4 ms 7252 KB Output is correct
9 Correct 4 ms 7252 KB Output is correct
10 Correct 4 ms 7252 KB Output is correct
11 Correct 4 ms 7252 KB Output is correct
12 Correct 4 ms 7252 KB Output is correct
13 Correct 4 ms 7380 KB Output is correct
14 Correct 5 ms 7376 KB Output is correct
15 Correct 4 ms 7380 KB Output is correct
16 Correct 4 ms 7380 KB Output is correct
17 Correct 5 ms 7368 KB Output is correct
18 Correct 6 ms 7360 KB Output is correct
19 Correct 4 ms 7364 KB Output is correct
20 Correct 6 ms 7368 KB Output is correct
21 Correct 5 ms 7380 KB Output is correct
22 Correct 26 ms 11768 KB Output is correct
23 Correct 25 ms 11760 KB Output is correct
24 Correct 23 ms 11792 KB Output is correct
25 Correct 7 ms 7500 KB Output is correct
26 Correct 6 ms 7504 KB Output is correct
27 Correct 5 ms 7508 KB Output is correct
28 Correct 5 ms 7480 KB Output is correct
29 Correct 5 ms 7508 KB Output is correct
30 Correct 5 ms 7488 KB Output is correct
31 Correct 13 ms 8660 KB Output is correct
32 Correct 13 ms 8660 KB Output is correct
33 Correct 12 ms 8648 KB Output is correct
34 Correct 12 ms 8660 KB Output is correct
35 Correct 11 ms 8572 KB Output is correct
36 Correct 13 ms 8664 KB Output is correct
37 Correct 26 ms 12164 KB Output is correct
38 Correct 26 ms 12288 KB Output is correct
39 Correct 35 ms 12236 KB Output is correct
40 Correct 12 ms 8148 KB Output is correct
41 Correct 9 ms 7828 KB Output is correct
42 Correct 12 ms 8336 KB Output is correct
43 Correct 10 ms 8012 KB Output is correct
44 Correct 8 ms 7884 KB Output is correct
45 Correct 11 ms 8268 KB Output is correct
46 Correct 49 ms 17496 KB Output is correct
47 Correct 30 ms 12948 KB Output is correct
48 Correct 34 ms 15600 KB Output is correct
49 Correct 38 ms 16048 KB Output is correct
50 Correct 37 ms 15700 KB Output is correct
51 Correct 30 ms 13388 KB Output is correct
52 Correct 12 ms 8276 KB Output is correct
53 Correct 12 ms 8276 KB Output is correct
54 Correct 11 ms 8276 KB Output is correct
55 Correct 11 ms 8276 KB Output is correct
56 Correct 11 ms 8264 KB Output is correct
57 Correct 11 ms 8276 KB Output is correct
58 Correct 56 ms 18328 KB Output is correct
59 Correct 47 ms 18380 KB Output is correct
60 Correct 46 ms 18368 KB Output is correct
61 Correct 46 ms 18276 KB Output is correct
62 Correct 47 ms 18368 KB Output is correct
63 Correct 46 ms 18380 KB Output is correct
64 Correct 47 ms 17736 KB Output is correct
65 Correct 46 ms 17740 KB Output is correct
66 Correct 61 ms 17748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 7252 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 4 ms 7252 KB Output is correct
4 Correct 4 ms 7308 KB Output is correct
5 Correct 4 ms 7360 KB Output is correct
6 Correct 4 ms 7336 KB Output is correct
7 Correct 4 ms 7356 KB Output is correct
8 Correct 4 ms 7252 KB Output is correct
9 Correct 4 ms 7252 KB Output is correct
10 Correct 4 ms 7252 KB Output is correct
11 Correct 4 ms 7252 KB Output is correct
12 Correct 4 ms 7252 KB Output is correct
13 Correct 4 ms 7380 KB Output is correct
14 Correct 5 ms 7376 KB Output is correct
15 Correct 4 ms 7380 KB Output is correct
16 Correct 4 ms 7380 KB Output is correct
17 Correct 5 ms 7368 KB Output is correct
18 Correct 6 ms 7360 KB Output is correct
19 Correct 4 ms 7364 KB Output is correct
20 Correct 6 ms 7368 KB Output is correct
21 Correct 5 ms 7380 KB Output is correct
22 Correct 4 ms 7364 KB Output is correct
23 Correct 4 ms 7252 KB Output is correct
24 Correct 4 ms 7360 KB Output is correct
25 Correct 4 ms 7356 KB Output is correct
26 Correct 4 ms 7252 KB Output is correct
27 Correct 4 ms 7252 KB Output is correct
28 Correct 5 ms 7252 KB Output is correct
29 Correct 4 ms 7360 KB Output is correct
30 Correct 4 ms 7356 KB Output is correct
31 Correct 4 ms 7252 KB Output is correct
32 Correct 4 ms 7360 KB Output is correct
33 Correct 4 ms 7380 KB Output is correct
34 Correct 4 ms 7380 KB Output is correct
35 Correct 4 ms 7380 KB Output is correct
36 Correct 4 ms 7380 KB Output is correct
37 Correct 4 ms 7360 KB Output is correct
38 Correct 4 ms 7364 KB Output is correct
39 Correct 4 ms 7252 KB Output is correct
40 Correct 4 ms 7364 KB Output is correct
41 Correct 4 ms 7380 KB Output is correct
42 Correct 4 ms 7380 KB Output is correct
43 Correct 4 ms 7380 KB Output is correct
44 Correct 4 ms 7252 KB Output is correct
45 Correct 4 ms 7252 KB Output is correct
46 Correct 4 ms 7340 KB Output is correct
47 Correct 4 ms 7380 KB Output is correct
48 Correct 4 ms 7380 KB Output is correct
49 Correct 4 ms 7380 KB Output is correct
50 Correct 4 ms 7380 KB Output is correct
51 Correct 6 ms 7380 KB Output is correct
52 Correct 4 ms 7380 KB Output is correct
53 Correct 4 ms 7380 KB Output is correct
54 Correct 4 ms 7360 KB Output is correct
55 Correct 4 ms 7380 KB Output is correct
56 Correct 4 ms 7380 KB Output is correct
57 Correct 4 ms 7380 KB Output is correct
58 Correct 4 ms 7380 KB Output is correct
59 Correct 4 ms 7380 KB Output is correct
60 Correct 4 ms 7380 KB Output is correct
61 Correct 4 ms 7380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 7364 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 4 ms 7252 KB Output is correct
4 Correct 4 ms 7252 KB Output is correct
5 Correct 4 ms 7252 KB Output is correct
6 Correct 4 ms 7308 KB Output is correct
7 Correct 4 ms 7360 KB Output is correct
8 Correct 4 ms 7336 KB Output is correct
9 Correct 4 ms 7356 KB Output is correct
10 Correct 4 ms 7252 KB Output is correct
11 Correct 4 ms 7252 KB Output is correct
12 Correct 4 ms 7252 KB Output is correct
13 Correct 4 ms 7252 KB Output is correct
14 Correct 4 ms 7252 KB Output is correct
15 Correct 4 ms 7380 KB Output is correct
16 Correct 5 ms 7376 KB Output is correct
17 Correct 4 ms 7380 KB Output is correct
18 Correct 4 ms 7380 KB Output is correct
19 Correct 5 ms 7368 KB Output is correct
20 Correct 6 ms 7360 KB Output is correct
21 Correct 4 ms 7364 KB Output is correct
22 Correct 6 ms 7368 KB Output is correct
23 Correct 5 ms 7380 KB Output is correct
24 Correct 26 ms 11768 KB Output is correct
25 Correct 25 ms 11760 KB Output is correct
26 Correct 23 ms 11792 KB Output is correct
27 Correct 4 ms 7360 KB Output is correct
28 Correct 4 ms 7356 KB Output is correct
29 Correct 4 ms 7252 KB Output is correct
30 Correct 4 ms 7252 KB Output is correct
31 Correct 5 ms 7252 KB Output is correct
32 Correct 4 ms 7360 KB Output is correct
33 Correct 4 ms 7356 KB Output is correct
34 Correct 4 ms 7252 KB Output is correct
35 Correct 4 ms 7360 KB Output is correct
36 Correct 4 ms 7380 KB Output is correct
37 Correct 4 ms 7380 KB Output is correct
38 Correct 4 ms 7380 KB Output is correct
39 Correct 4 ms 7380 KB Output is correct
40 Correct 4 ms 7360 KB Output is correct
41 Correct 4 ms 7364 KB Output is correct
42 Correct 4 ms 7252 KB Output is correct
43 Correct 4 ms 7364 KB Output is correct
44 Correct 4 ms 7380 KB Output is correct
45 Correct 4 ms 7380 KB Output is correct
46 Correct 4 ms 7380 KB Output is correct
47 Correct 4 ms 7252 KB Output is correct
48 Correct 4 ms 7252 KB Output is correct
49 Correct 4 ms 7340 KB Output is correct
50 Correct 4 ms 7380 KB Output is correct
51 Correct 4 ms 7380 KB Output is correct
52 Correct 4 ms 7380 KB Output is correct
53 Correct 4 ms 7380 KB Output is correct
54 Correct 6 ms 7380 KB Output is correct
55 Correct 4 ms 7380 KB Output is correct
56 Correct 4 ms 7380 KB Output is correct
57 Correct 4 ms 7360 KB Output is correct
58 Correct 4 ms 7380 KB Output is correct
59 Correct 4 ms 7380 KB Output is correct
60 Correct 4 ms 7380 KB Output is correct
61 Correct 4 ms 7380 KB Output is correct
62 Correct 4 ms 7380 KB Output is correct
63 Correct 4 ms 7380 KB Output is correct
64 Correct 4 ms 7380 KB Output is correct
65 Correct 4 ms 7380 KB Output is correct
66 Correct 4 ms 7356 KB Output is correct
67 Correct 4 ms 7380 KB Output is correct
68 Correct 4 ms 7380 KB Output is correct
69 Correct 4 ms 7380 KB Output is correct
70 Correct 6 ms 7500 KB Output is correct
71 Correct 6 ms 7508 KB Output is correct
72 Correct 5 ms 7508 KB Output is correct
73 Correct 5 ms 7508 KB Output is correct
74 Correct 5 ms 7508 KB Output is correct
75 Correct 5 ms 7500 KB Output is correct
76 Correct 31 ms 10612 KB Output is correct
77 Correct 28 ms 11084 KB Output is correct
78 Correct 42 ms 11600 KB Output is correct
79 Correct 5 ms 7356 KB Output is correct
80 Correct 5 ms 7356 KB Output is correct
81 Correct 5 ms 7356 KB Output is correct
82 Correct 5 ms 7380 KB Output is correct
83 Correct 5 ms 7352 KB Output is correct
84 Correct 6 ms 7636 KB Output is correct
85 Correct 7 ms 7636 KB Output is correct
86 Correct 6 ms 7580 KB Output is correct
87 Correct 6 ms 7636 KB Output is correct
88 Correct 6 ms 7628 KB Output is correct
89 Correct 6 ms 7628 KB Output is correct
90 Correct 31 ms 11932 KB Output is correct
91 Correct 31 ms 11880 KB Output is correct
92 Correct 31 ms 11936 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 7364 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 4 ms 7252 KB Output is correct
4 Correct 4 ms 7252 KB Output is correct
5 Correct 4 ms 7252 KB Output is correct
6 Correct 4 ms 7308 KB Output is correct
7 Correct 4 ms 7360 KB Output is correct
8 Correct 4 ms 7336 KB Output is correct
9 Correct 4 ms 7356 KB Output is correct
10 Correct 4 ms 7252 KB Output is correct
11 Correct 4 ms 7252 KB Output is correct
12 Correct 4 ms 7252 KB Output is correct
13 Correct 4 ms 7252 KB Output is correct
14 Correct 4 ms 7252 KB Output is correct
15 Correct 4 ms 7380 KB Output is correct
16 Correct 5 ms 7376 KB Output is correct
17 Correct 4 ms 7380 KB Output is correct
18 Correct 4 ms 7380 KB Output is correct
19 Correct 5 ms 7368 KB Output is correct
20 Correct 6 ms 7360 KB Output is correct
21 Correct 4 ms 7364 KB Output is correct
22 Correct 6 ms 7368 KB Output is correct
23 Correct 5 ms 7380 KB Output is correct
24 Correct 26 ms 11768 KB Output is correct
25 Correct 25 ms 11760 KB Output is correct
26 Correct 23 ms 11792 KB Output is correct
27 Correct 7 ms 7500 KB Output is correct
28 Correct 6 ms 7504 KB Output is correct
29 Correct 5 ms 7508 KB Output is correct
30 Correct 5 ms 7480 KB Output is correct
31 Correct 5 ms 7508 KB Output is correct
32 Correct 5 ms 7488 KB Output is correct
33 Correct 13 ms 8660 KB Output is correct
34 Correct 13 ms 8660 KB Output is correct
35 Correct 12 ms 8648 KB Output is correct
36 Correct 12 ms 8660 KB Output is correct
37 Correct 11 ms 8572 KB Output is correct
38 Correct 13 ms 8664 KB Output is correct
39 Correct 26 ms 12164 KB Output is correct
40 Correct 26 ms 12288 KB Output is correct
41 Correct 35 ms 12236 KB Output is correct
42 Correct 4 ms 7360 KB Output is correct
43 Correct 4 ms 7356 KB Output is correct
44 Correct 4 ms 7252 KB Output is correct
45 Correct 4 ms 7252 KB Output is correct
46 Correct 5 ms 7252 KB Output is correct
47 Correct 4 ms 7360 KB Output is correct
48 Correct 4 ms 7356 KB Output is correct
49 Correct 4 ms 7252 KB Output is correct
50 Correct 4 ms 7360 KB Output is correct
51 Correct 4 ms 7380 KB Output is correct
52 Correct 4 ms 7380 KB Output is correct
53 Correct 4 ms 7380 KB Output is correct
54 Correct 4 ms 7380 KB Output is correct
55 Correct 4 ms 7360 KB Output is correct
56 Correct 4 ms 7364 KB Output is correct
57 Correct 4 ms 7252 KB Output is correct
58 Correct 4 ms 7364 KB Output is correct
59 Correct 4 ms 7380 KB Output is correct
60 Correct 4 ms 7380 KB Output is correct
61 Correct 4 ms 7380 KB Output is correct
62 Correct 4 ms 7252 KB Output is correct
63 Correct 4 ms 7252 KB Output is correct
64 Correct 4 ms 7340 KB Output is correct
65 Correct 4 ms 7380 KB Output is correct
66 Correct 4 ms 7380 KB Output is correct
67 Correct 4 ms 7380 KB Output is correct
68 Correct 4 ms 7380 KB Output is correct
69 Correct 6 ms 7380 KB Output is correct
70 Correct 4 ms 7380 KB Output is correct
71 Correct 4 ms 7380 KB Output is correct
72 Correct 4 ms 7360 KB Output is correct
73 Correct 4 ms 7380 KB Output is correct
74 Correct 4 ms 7380 KB Output is correct
75 Correct 4 ms 7380 KB Output is correct
76 Correct 4 ms 7380 KB Output is correct
77 Correct 4 ms 7380 KB Output is correct
78 Correct 4 ms 7380 KB Output is correct
79 Correct 4 ms 7380 KB Output is correct
80 Correct 4 ms 7380 KB Output is correct
81 Correct 4 ms 7356 KB Output is correct
82 Correct 4 ms 7380 KB Output is correct
83 Correct 4 ms 7380 KB Output is correct
84 Correct 4 ms 7380 KB Output is correct
85 Correct 6 ms 7500 KB Output is correct
86 Correct 6 ms 7508 KB Output is correct
87 Correct 5 ms 7508 KB Output is correct
88 Correct 5 ms 7508 KB Output is correct
89 Correct 5 ms 7508 KB Output is correct
90 Correct 5 ms 7500 KB Output is correct
91 Correct 31 ms 10612 KB Output is correct
92 Correct 28 ms 11084 KB Output is correct
93 Correct 42 ms 11600 KB Output is correct
94 Correct 5 ms 7356 KB Output is correct
95 Correct 5 ms 7356 KB Output is correct
96 Correct 5 ms 7356 KB Output is correct
97 Correct 5 ms 7380 KB Output is correct
98 Correct 5 ms 7352 KB Output is correct
99 Correct 6 ms 7636 KB Output is correct
100 Correct 7 ms 7636 KB Output is correct
101 Correct 6 ms 7580 KB Output is correct
102 Correct 6 ms 7636 KB Output is correct
103 Correct 6 ms 7628 KB Output is correct
104 Correct 6 ms 7628 KB Output is correct
105 Correct 31 ms 11932 KB Output is correct
106 Correct 31 ms 11880 KB Output is correct
107 Correct 31 ms 11936 KB Output is correct
108 Correct 5 ms 7508 KB Output is correct
109 Correct 89 ms 7508 KB Output is correct
110 Correct 6 ms 7556 KB Output is correct
111 Correct 7 ms 7508 KB Output is correct
112 Correct 7 ms 7508 KB Output is correct
113 Correct 6 ms 7504 KB Output is correct
114 Correct 16 ms 8980 KB Output is correct
115 Correct 22 ms 8812 KB Output is correct
116 Correct 20 ms 9172 KB Output is correct
117 Correct 17 ms 8844 KB Output is correct
118 Correct 17 ms 9036 KB Output is correct
119 Correct 14 ms 8720 KB Output is correct
120 Correct 21 ms 10332 KB Output is correct
121 Correct 7 ms 8020 KB Output is correct
122 Correct 25 ms 10660 KB Output is correct
123 Correct 7 ms 7892 KB Output is correct
124 Correct 26 ms 11248 KB Output is correct
125 Correct 10 ms 8148 KB Output is correct
126 Correct 11 ms 8272 KB Output is correct
127 Correct 14 ms 8520 KB Output is correct
128 Correct 9 ms 8148 KB Output is correct
129 Correct 11 ms 8268 KB Output is correct
130 Correct 7 ms 7508 KB Output is correct
131 Correct 109 ms 7636 KB Output is correct
132 Correct 8 ms 7636 KB Output is correct
133 Correct 8 ms 7636 KB Output is correct
134 Correct 8 ms 7628 KB Output is correct
135 Correct 7 ms 7636 KB Output is correct
136 Correct 22 ms 9452 KB Output is correct
137 Correct 21 ms 9468 KB Output is correct
138 Correct 20 ms 9440 KB Output is correct
139 Correct 21 ms 9532 KB Output is correct
140 Correct 21 ms 9540 KB Output is correct
141 Correct 21 ms 9420 KB Output is correct
142 Correct 33 ms 12324 KB Output is correct
143 Correct 11 ms 8404 KB Output is correct
144 Correct 39 ms 12376 KB Output is correct
145 Correct 10 ms 8340 KB Output is correct
146 Correct 39 ms 12400 KB Output is correct
147 Correct 11 ms 8348 KB Output is correct
148 Correct 13 ms 8788 KB Output is correct
149 Correct 13 ms 8660 KB Output is correct
150 Correct 13 ms 8660 KB Output is correct
151 Correct 14 ms 8660 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 7364 KB Output is correct
2 Correct 4 ms 7252 KB Output is correct
3 Correct 4 ms 7252 KB Output is correct
4 Correct 4 ms 7252 KB Output is correct
5 Correct 4 ms 7252 KB Output is correct
6 Correct 4 ms 7308 KB Output is correct
7 Correct 4 ms 7360 KB Output is correct
8 Correct 4 ms 7336 KB Output is correct
9 Correct 4 ms 7356 KB Output is correct
10 Correct 4 ms 7252 KB Output is correct
11 Correct 4 ms 7252 KB Output is correct
12 Correct 4 ms 7252 KB Output is correct
13 Correct 4 ms 7252 KB Output is correct
14 Correct 4 ms 7252 KB Output is correct
15 Correct 4 ms 7380 KB Output is correct
16 Correct 5 ms 7376 KB Output is correct
17 Correct 4 ms 7380 KB Output is correct
18 Correct 4 ms 7380 KB Output is correct
19 Correct 5 ms 7368 KB Output is correct
20 Correct 6 ms 7360 KB Output is correct
21 Correct 4 ms 7364 KB Output is correct
22 Correct 6 ms 7368 KB Output is correct
23 Correct 5 ms 7380 KB Output is correct
24 Correct 26 ms 11768 KB Output is correct
25 Correct 25 ms 11760 KB Output is correct
26 Correct 23 ms 11792 KB Output is correct
27 Correct 7 ms 7500 KB Output is correct
28 Correct 6 ms 7504 KB Output is correct
29 Correct 5 ms 7508 KB Output is correct
30 Correct 5 ms 7480 KB Output is correct
31 Correct 5 ms 7508 KB Output is correct
32 Correct 5 ms 7488 KB Output is correct
33 Correct 13 ms 8660 KB Output is correct
34 Correct 13 ms 8660 KB Output is correct
35 Correct 12 ms 8648 KB Output is correct
36 Correct 12 ms 8660 KB Output is correct
37 Correct 11 ms 8572 KB Output is correct
38 Correct 13 ms 8664 KB Output is correct
39 Correct 26 ms 12164 KB Output is correct
40 Correct 26 ms 12288 KB Output is correct
41 Correct 35 ms 12236 KB Output is correct
42 Correct 12 ms 8148 KB Output is correct
43 Correct 9 ms 7828 KB Output is correct
44 Correct 12 ms 8336 KB Output is correct
45 Correct 10 ms 8012 KB Output is correct
46 Correct 8 ms 7884 KB Output is correct
47 Correct 11 ms 8268 KB Output is correct
48 Correct 49 ms 17496 KB Output is correct
49 Correct 30 ms 12948 KB Output is correct
50 Correct 34 ms 15600 KB Output is correct
51 Correct 38 ms 16048 KB Output is correct
52 Correct 37 ms 15700 KB Output is correct
53 Correct 30 ms 13388 KB Output is correct
54 Correct 12 ms 8276 KB Output is correct
55 Correct 12 ms 8276 KB Output is correct
56 Correct 11 ms 8276 KB Output is correct
57 Correct 11 ms 8276 KB Output is correct
58 Correct 11 ms 8264 KB Output is correct
59 Correct 11 ms 8276 KB Output is correct
60 Correct 56 ms 18328 KB Output is correct
61 Correct 47 ms 18380 KB Output is correct
62 Correct 46 ms 18368 KB Output is correct
63 Correct 46 ms 18276 KB Output is correct
64 Correct 47 ms 18368 KB Output is correct
65 Correct 46 ms 18380 KB Output is correct
66 Correct 47 ms 17736 KB Output is correct
67 Correct 46 ms 17740 KB Output is correct
68 Correct 61 ms 17748 KB Output is correct
69 Correct 4 ms 7360 KB Output is correct
70 Correct 4 ms 7356 KB Output is correct
71 Correct 4 ms 7252 KB Output is correct
72 Correct 4 ms 7252 KB Output is correct
73 Correct 5 ms 7252 KB Output is correct
74 Correct 4 ms 7360 KB Output is correct
75 Correct 4 ms 7356 KB Output is correct
76 Correct 4 ms 7252 KB Output is correct
77 Correct 4 ms 7360 KB Output is correct
78 Correct 4 ms 7380 KB Output is correct
79 Correct 4 ms 7380 KB Output is correct
80 Correct 4 ms 7380 KB Output is correct
81 Correct 4 ms 7380 KB Output is correct
82 Correct 4 ms 7360 KB Output is correct
83 Correct 4 ms 7364 KB Output is correct
84 Correct 4 ms 7252 KB Output is correct
85 Correct 4 ms 7364 KB Output is correct
86 Correct 4 ms 7380 KB Output is correct
87 Correct 4 ms 7380 KB Output is correct
88 Correct 4 ms 7380 KB Output is correct
89 Correct 4 ms 7252 KB Output is correct
90 Correct 4 ms 7252 KB Output is correct
91 Correct 4 ms 7340 KB Output is correct
92 Correct 4 ms 7380 KB Output is correct
93 Correct 4 ms 7380 KB Output is correct
94 Correct 4 ms 7380 KB Output is correct
95 Correct 4 ms 7380 KB Output is correct
96 Correct 6 ms 7380 KB Output is correct
97 Correct 4 ms 7380 KB Output is correct
98 Correct 4 ms 7380 KB Output is correct
99 Correct 4 ms 7360 KB Output is correct
100 Correct 4 ms 7380 KB Output is correct
101 Correct 4 ms 7380 KB Output is correct
102 Correct 4 ms 7380 KB Output is correct
103 Correct 4 ms 7380 KB Output is correct
104 Correct 4 ms 7380 KB Output is correct
105 Correct 4 ms 7380 KB Output is correct
106 Correct 4 ms 7380 KB Output is correct
107 Correct 4 ms 7380 KB Output is correct
108 Correct 4 ms 7356 KB Output is correct
109 Correct 4 ms 7380 KB Output is correct
110 Correct 4 ms 7380 KB Output is correct
111 Correct 4 ms 7380 KB Output is correct
112 Correct 6 ms 7500 KB Output is correct
113 Correct 6 ms 7508 KB Output is correct
114 Correct 5 ms 7508 KB Output is correct
115 Correct 5 ms 7508 KB Output is correct
116 Correct 5 ms 7508 KB Output is correct
117 Correct 5 ms 7500 KB Output is correct
118 Correct 31 ms 10612 KB Output is correct
119 Correct 28 ms 11084 KB Output is correct
120 Correct 42 ms 11600 KB Output is correct
121 Correct 5 ms 7356 KB Output is correct
122 Correct 5 ms 7356 KB Output is correct
123 Correct 5 ms 7356 KB Output is correct
124 Correct 5 ms 7380 KB Output is correct
125 Correct 5 ms 7352 KB Output is correct
126 Correct 6 ms 7636 KB Output is correct
127 Correct 7 ms 7636 KB Output is correct
128 Correct 6 ms 7580 KB Output is correct
129 Correct 6 ms 7636 KB Output is correct
130 Correct 6 ms 7628 KB Output is correct
131 Correct 6 ms 7628 KB Output is correct
132 Correct 31 ms 11932 KB Output is correct
133 Correct 31 ms 11880 KB Output is correct
134 Correct 31 ms 11936 KB Output is correct
135 Correct 5 ms 7508 KB Output is correct
136 Correct 89 ms 7508 KB Output is correct
137 Correct 6 ms 7556 KB Output is correct
138 Correct 7 ms 7508 KB Output is correct
139 Correct 7 ms 7508 KB Output is correct
140 Correct 6 ms 7504 KB Output is correct
141 Correct 16 ms 8980 KB Output is correct
142 Correct 22 ms 8812 KB Output is correct
143 Correct 20 ms 9172 KB Output is correct
144 Correct 17 ms 8844 KB Output is correct
145 Correct 17 ms 9036 KB Output is correct
146 Correct 14 ms 8720 KB Output is correct
147 Correct 21 ms 10332 KB Output is correct
148 Correct 7 ms 8020 KB Output is correct
149 Correct 25 ms 10660 KB Output is correct
150 Correct 7 ms 7892 KB Output is correct
151 Correct 26 ms 11248 KB Output is correct
152 Correct 10 ms 8148 KB Output is correct
153 Correct 11 ms 8272 KB Output is correct
154 Correct 14 ms 8520 KB Output is correct
155 Correct 9 ms 8148 KB Output is correct
156 Correct 11 ms 8268 KB Output is correct
157 Correct 7 ms 7508 KB Output is correct
158 Correct 109 ms 7636 KB Output is correct
159 Correct 8 ms 7636 KB Output is correct
160 Correct 8 ms 7636 KB Output is correct
161 Correct 8 ms 7628 KB Output is correct
162 Correct 7 ms 7636 KB Output is correct
163 Correct 22 ms 9452 KB Output is correct
164 Correct 21 ms 9468 KB Output is correct
165 Correct 20 ms 9440 KB Output is correct
166 Correct 21 ms 9532 KB Output is correct
167 Correct 21 ms 9540 KB Output is correct
168 Correct 21 ms 9420 KB Output is correct
169 Correct 33 ms 12324 KB Output is correct
170 Correct 11 ms 8404 KB Output is correct
171 Correct 39 ms 12376 KB Output is correct
172 Correct 10 ms 8340 KB Output is correct
173 Correct 39 ms 12400 KB Output is correct
174 Correct 11 ms 8348 KB Output is correct
175 Correct 13 ms 8788 KB Output is correct
176 Correct 13 ms 8660 KB Output is correct
177 Correct 13 ms 8660 KB Output is correct
178 Correct 14 ms 8660 KB Output is correct
179 Correct 10 ms 7884 KB Output is correct
180 Correct 220 ms 7932 KB Output is correct
181 Correct 11 ms 8164 KB Output is correct
182 Correct 13 ms 8468 KB Output is correct
183 Correct 10 ms 8140 KB Output is correct
184 Correct 10 ms 8020 KB Output is correct
185 Correct 30 ms 11468 KB Output is correct
186 Correct 31 ms 12992 KB Output is correct
187 Correct 48 ms 12340 KB Output is correct
188 Correct 32 ms 11820 KB Output is correct
189 Correct 36 ms 11724 KB Output is correct
190 Correct 35 ms 13024 KB Output is correct
191 Correct 34 ms 12544 KB Output is correct
192 Correct 26 ms 11084 KB Output is correct
193 Correct 25 ms 10512 KB Output is correct
194 Correct 13 ms 8272 KB Output is correct
195 Correct 586 ms 8424 KB Output is correct
196 Correct 13 ms 8404 KB Output is correct
197 Correct 13 ms 8396 KB Output is correct
198 Correct 14 ms 8512 KB Output is correct
199 Correct 18 ms 8520 KB Output is correct
200 Correct 84 ms 18872 KB Output is correct
201 Correct 66 ms 18892 KB Output is correct
202 Correct 64 ms 18872 KB Output is correct
203 Correct 64 ms 18892 KB Output is correct
204 Correct 65 ms 18888 KB Output is correct
205 Correct 63 ms 18964 KB Output is correct
206 Correct 58 ms 17964 KB Output is correct
207 Correct 64 ms 17360 KB Output is correct
208 Correct 58 ms 18080 KB Output is correct
209 Correct 48 ms 17444 KB Output is correct
210 Correct 55 ms 17996 KB Output is correct
211 Correct 49 ms 17444 KB Output is correct
212 Correct 60 ms 18636 KB Output is correct
213 Correct 51 ms 15644 KB Output is correct
214 Correct 58 ms 15160 KB Output is correct
215 Correct 66 ms 15048 KB Output is correct