Submission #522507

# Submission time Handle Problem Language Result Execution time Memory
522507 2022-02-05T05:37:01 Z PCTprobability Painting Walls (APIO20_paint) C++17
100 / 100
540 ms 253996 KB
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using ll = int;
using ld = long double;
using ull = unsigned long long;
#define endl "\n"
typedef pair<int,int> Pii;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REP3(i, m, n) for (int i = (m); (i) < int(n); ++ (i))
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define ALL(x) begin(x), end(x)
#define PB push_back
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(s) (s).begin(),(s).end()
#define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i)
#define drep(i, n) drep2(i, n, 0)
#define rever(vec) reverse(vec.begin(), vec.end())
#define sor(vec) sort(vec.begin(), vec.end())
#define fi first
#define se second
#define pb push_back
#define P pair<ll,ll>
#define PQminll priority_queue<ll, vector<ll>, greater<ll>>
#define PQmaxll priority_queue<ll,vector<ll>,less<ll>>
#define PQminP priority_queue<P, vector<P>, greater<P>>
#define PQmaxP priority_queue<P,vector<P>,less<P>>
#define NP next_permutation
//typedef string::const_iterator State;
//class ParseError {};
//const ll mod = 1000000009;
const ll mod = 998244353;
//const ll mod = 1000000007;
const ll inf = 4100000000000000000ll;
const ld eps = ld(0.000000001);
const long double pi = 3.141592653589793;
template<class T>void vcin(vector<T> &n){for(int i=0;i<int(n.size());i++) cin>>n[i];}
template<class T,class K>void vcin(vector<T> &n,vector<K> &m){for(int i=0;i<int(n.size());i++) cin>>n[i]>>m[i];}
template<class T>void vcout(vector<T> &n){for(int i=0;i<int(n.size());i++){cout<<n[i]<<" ";}cout<<endl;}
template<class T>void vcin(vector<vector<T>> &n){for(int i=0;i<int(n.size());i++){for(int j=0;j<int(n[i].size());j++){cin>>n[i][j];}}}
template<class T>void vcout(vector<vector<T>> &n){for(int i=0;i<int(n.size());i++){for(int j=0;j<int(n[i].size());j++){cout<<n[i][j]<<" ";}cout<<endl;}cout<<endl;}
void yes(bool a){cout<<(a?"yes":"no")<<endl;}
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}
void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
void possible(bool a){ cout<<(a?"possible":"impossible")<<endl; }
void Possible(bool a){ cout<<(a?"Possible":"Impossible")<<endl; }
void POSSIBLE(bool a){ cout<<(a?"POSSIBLE":"IMPOSSIBLE")<<endl; }
template<class T>void print(T a){cout<<a<<endl;}
template<class T,class F>void print(pair<T,F> a){cout<<a.fi<<" "<<a.se<<endl;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0;}
template<class T> void ifmin(T t,T u){if(t>u){cout<<-1<<endl;}else{cout<<t<<endl;}}
template<class T> void ifmax(T t,T u){if(t>u){cout<<-1<<endl;}else{cout<<t<<endl;}}
ll fastgcd(ll u,ll v){ll shl=0;while(u&&v&&u!=v){bool eu=!(u&1);bool ev=!(v&1);if(eu&&ev){++shl;u>>=1;v>>=1;}else if(eu&&!ev){u>>=1;}else if(!eu&&ev){v>>=1;}else if(u>=v){u=(u-v)>>1;}else{ll tmp=u;u=(v-u)>>1;v=tmp;}}return !u?v<<shl:u<<shl;}
ll modPow(ll a, ll n, ll mod) { if(mod==1) return 0;ll ret = 1; ll p = a % mod; while (n) { if (n & 1) ret = ret * p % mod; p = p * p % mod; n >>= 1; } return ret; }
vector<ll> divisor(ll x){ vector<ll> ans; for(ll i = 1; i * i <= x; i++){ if(x % i == 0) {ans.push_back(i); if(i*i!=x){ ans.push_back(x / ans[i]);}}}sor(ans); return ans; }
ll pop(ll x){return __builtin_popcountll(x);}
ll poplong(ll x){ll y=0;while(x){x/=2;y++;}return y;}
 
void cincout() {
  ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
  cout<< fixed << setprecision(10);
}
 
int minimumInstructions(int N,int M,int K,vector<int> C,vector<int> A,vector<vector<int>> B){
  ll n=N;
  ll m=M;
  ll k=K;
  vector<vector<ll>> ind(k);
  for(int i=0;i<m;i++){
    for(int j=0;j<A[i];j++){
      ind[B[i][j]].pb(i);
    }
  }
  for(auto &e:C){
    if(ind[e].size()==0){
      return -1;
    }
  }
  //それぞれのサイズは高々 sqrt(4e5)
  vector<P> kukan;
  vector<vector<ll>> dp(n);
  for(int i=0;i<n;i++){
    dp[i].resize(ind[C[i]].size());
  }
  for(int i=0;i<n;i++){
    bool f=false;
    ll now=0;
    for(int j=0;j<ind[C[i]].size();j++){
      ll x=ind[C[i]][j];
      chmax(dp[i][j],1);
      if(dp[i][j]>=m) f=true;
      if(i+1<n){
        if(x+1==m){
          if(ind[C[i+1]][0]==0){
            dp[i+1][0]=dp[i][j]+1;
          }
        }
        else{
          while(now<ind[C[i+1]].size()&&ind[C[i+1]][now]<x+1) now++;
          if(now<ind[C[i+1]].size()&&ind[C[i+1]][now]==(x+1)%m) dp[i+1][now]=dp[i][j]+1;
        }
      }
    }
    if(f) kukan.pb({i-m+1,i});
  }
  sor(kukan);
  vector<ll> rui(n+1);
  for(int i=0;i<kukan.size();i++){
    rui[kukan[i].fi]++;
    rui[kukan[i].se+1]--;
  }
  for(int i=1;i<n;i++) rui[i]+=rui[i-1];
  for(int i=0;i<n;i++){
    if(rui[i]==0){
      return -1;
    }
  }
  ll ans=0;
  ll last=-1;
  for(int i=0;i<kukan.size();i++){
    if(i+1<kukan.size()){
      if(last+1<kukan[i+1].fi){
        ans++;
        last=kukan[i].se;
      }
    }
    else{
      ans++;
    }
  }
  return ans;
}

Compilation message

paint.cpp:39:16: warning: overflow in conversion from 'long long int' to 'll' {aka 'int'} changes value from '4100000000000000000' to '-82182144' [-Woverflow]
   39 | const ll inf = 4100000000000000000ll;
      |                ^~~~~~~~~~~~~~~~~~~~~
paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:95:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   95 |     for(int j=0;j<ind[C[i]].size();j++){
      |                 ~^~~~~~~~~~~~~~~~~
paint.cpp:106:20: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  106 |           while(now<ind[C[i+1]].size()&&ind[C[i+1]][now]<x+1) now++;
      |                 ~~~^~~~~~~~~~~~~~~~~~~
paint.cpp:107:17: warning: comparison of integer expressions of different signedness: 'll' {aka 'int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  107 |           if(now<ind[C[i+1]].size()&&ind[C[i+1]][now]==(x+1)%m) dp[i+1][now]=dp[i][j]+1;
      |              ~~~^~~~~~~~~~~~~~~~~~~
paint.cpp:115:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  115 |   for(int i=0;i<kukan.size();i++){
      |               ~^~~~~~~~~~~~~
paint.cpp:127:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  127 |   for(int i=0;i<kukan.size();i++){
      |               ~^~~~~~~~~~~~~
paint.cpp:128:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  128 |     if(i+1<kukan.size()){
      |        ~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 0 ms 332 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 2 ms 2636 KB Output is correct
14 Correct 2 ms 2636 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 1 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 2 ms 2636 KB Output is correct
21 Correct 2 ms 2636 KB Output is correct
22 Correct 21 ms 6604 KB Output is correct
23 Correct 23 ms 6604 KB Output is correct
24 Correct 25 ms 6508 KB Output is correct
25 Correct 4 ms 1868 KB Output is correct
26 Correct 4 ms 1868 KB Output is correct
27 Correct 5 ms 1740 KB Output is correct
28 Correct 4 ms 1612 KB Output is correct
29 Correct 4 ms 1612 KB Output is correct
30 Correct 3 ms 1528 KB Output is correct
31 Correct 10 ms 5148 KB Output is correct
32 Correct 10 ms 5196 KB Output is correct
33 Correct 10 ms 5196 KB Output is correct
34 Correct 10 ms 5100 KB Output is correct
35 Correct 11 ms 5196 KB Output is correct
36 Correct 9 ms 5200 KB Output is correct
37 Correct 24 ms 7996 KB Output is correct
38 Correct 23 ms 7996 KB Output is correct
39 Correct 24 ms 7924 KB Output is correct
40 Correct 17 ms 7152 KB Output is correct
41 Correct 10 ms 4424 KB Output is correct
42 Correct 17 ms 7364 KB Output is correct
43 Correct 12 ms 4708 KB Output is correct
44 Correct 11 ms 4172 KB Output is correct
45 Correct 17 ms 6840 KB Output is correct
46 Correct 56 ms 17184 KB Output is correct
47 Correct 29 ms 10948 KB Output is correct
48 Correct 36 ms 13160 KB Output is correct
49 Correct 39 ms 13504 KB Output is correct
50 Correct 41 ms 13652 KB Output is correct
51 Correct 33 ms 11368 KB Output is correct
52 Correct 18 ms 7732 KB Output is correct
53 Correct 19 ms 7628 KB Output is correct
54 Correct 18 ms 7480 KB Output is correct
55 Correct 18 ms 7132 KB Output is correct
56 Correct 18 ms 6860 KB Output is correct
57 Correct 16 ms 6860 KB Output is correct
58 Correct 53 ms 18716 KB Output is correct
59 Correct 52 ms 18800 KB Output is correct
60 Correct 54 ms 18748 KB Output is correct
61 Correct 56 ms 18748 KB Output is correct
62 Correct 58 ms 18796 KB Output is correct
63 Correct 54 ms 18720 KB Output is correct
64 Correct 55 ms 17476 KB Output is correct
65 Correct 52 ms 17396 KB Output is correct
66 Correct 54 ms 17440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 0 ms 332 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 2 ms 2636 KB Output is correct
14 Correct 2 ms 2636 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 1 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 2 ms 2636 KB Output is correct
21 Correct 2 ms 2636 KB Output is correct
22 Correct 0 ms 204 KB Output is correct
23 Correct 0 ms 204 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
26 Correct 0 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 332 KB Output is correct
29 Correct 0 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 0 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 2252 KB Output is correct
34 Correct 1 ms 1740 KB Output is correct
35 Correct 1 ms 1612 KB Output is correct
36 Correct 3 ms 2540 KB Output is correct
37 Correct 1 ms 2124 KB Output is correct
38 Correct 2 ms 2380 KB Output is correct
39 Correct 0 ms 332 KB Output is correct
40 Correct 1 ms 1996 KB Output is correct
41 Correct 1 ms 332 KB Output is correct
42 Correct 2 ms 2536 KB Output is correct
43 Correct 1 ms 2380 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 332 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 0 ms 332 KB Output is correct
50 Correct 2 ms 2636 KB Output is correct
51 Correct 2 ms 2636 KB Output is correct
52 Correct 2 ms 2636 KB Output is correct
53 Correct 2 ms 2636 KB Output is correct
54 Correct 2 ms 2636 KB Output is correct
55 Correct 2 ms 2636 KB Output is correct
56 Correct 3 ms 2636 KB Output is correct
57 Correct 1 ms 332 KB Output is correct
58 Correct 2 ms 2636 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 2 ms 2636 KB Output is correct
61 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 0 ms 332 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 1 ms 2636 KB Output is correct
21 Correct 2 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 21 ms 6604 KB Output is correct
25 Correct 23 ms 6604 KB Output is correct
26 Correct 25 ms 6508 KB Output is correct
27 Correct 0 ms 204 KB Output is correct
28 Correct 0 ms 204 KB Output is correct
29 Correct 0 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 332 KB Output is correct
32 Correct 0 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 0 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 2252 KB Output is correct
37 Correct 1 ms 1740 KB Output is correct
38 Correct 1 ms 1612 KB Output is correct
39 Correct 3 ms 2540 KB Output is correct
40 Correct 1 ms 2124 KB Output is correct
41 Correct 2 ms 2380 KB Output is correct
42 Correct 0 ms 332 KB Output is correct
43 Correct 1 ms 1996 KB Output is correct
44 Correct 1 ms 332 KB Output is correct
45 Correct 2 ms 2536 KB Output is correct
46 Correct 1 ms 2380 KB Output is correct
47 Correct 1 ms 204 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 0 ms 332 KB Output is correct
53 Correct 2 ms 2636 KB Output is correct
54 Correct 2 ms 2636 KB Output is correct
55 Correct 2 ms 2636 KB Output is correct
56 Correct 2 ms 2636 KB Output is correct
57 Correct 2 ms 2636 KB Output is correct
58 Correct 2 ms 2636 KB Output is correct
59 Correct 3 ms 2636 KB Output is correct
60 Correct 1 ms 332 KB Output is correct
61 Correct 2 ms 2636 KB Output is correct
62 Correct 1 ms 332 KB Output is correct
63 Correct 2 ms 2636 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 460 KB Output is correct
66 Correct 1 ms 332 KB Output is correct
67 Correct 1 ms 460 KB Output is correct
68 Correct 1 ms 460 KB Output is correct
69 Correct 1 ms 460 KB Output is correct
70 Correct 3 ms 2508 KB Output is correct
71 Correct 3 ms 2124 KB Output is correct
72 Correct 4 ms 1868 KB Output is correct
73 Correct 2 ms 1996 KB Output is correct
74 Correct 3 ms 2252 KB Output is correct
75 Correct 3 ms 2764 KB Output is correct
76 Correct 18 ms 4564 KB Output is correct
77 Correct 18 ms 5324 KB Output is correct
78 Correct 26 ms 6016 KB Output is correct
79 Correct 1 ms 716 KB Output is correct
80 Correct 1 ms 716 KB Output is correct
81 Correct 1 ms 716 KB Output is correct
82 Correct 1 ms 716 KB Output is correct
83 Correct 1 ms 716 KB Output is correct
84 Correct 3 ms 2892 KB Output is correct
85 Correct 3 ms 2892 KB Output is correct
86 Correct 3 ms 2892 KB Output is correct
87 Correct 4 ms 2892 KB Output is correct
88 Correct 4 ms 2892 KB Output is correct
89 Correct 3 ms 2892 KB Output is correct
90 Correct 26 ms 6396 KB Output is correct
91 Correct 26 ms 6272 KB Output is correct
92 Correct 28 ms 6304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 0 ms 332 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 1 ms 2636 KB Output is correct
21 Correct 2 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 21 ms 6604 KB Output is correct
25 Correct 23 ms 6604 KB Output is correct
26 Correct 25 ms 6508 KB Output is correct
27 Correct 4 ms 1868 KB Output is correct
28 Correct 4 ms 1868 KB Output is correct
29 Correct 5 ms 1740 KB Output is correct
30 Correct 4 ms 1612 KB Output is correct
31 Correct 4 ms 1612 KB Output is correct
32 Correct 3 ms 1528 KB Output is correct
33 Correct 10 ms 5148 KB Output is correct
34 Correct 10 ms 5196 KB Output is correct
35 Correct 10 ms 5196 KB Output is correct
36 Correct 10 ms 5100 KB Output is correct
37 Correct 11 ms 5196 KB Output is correct
38 Correct 9 ms 5200 KB Output is correct
39 Correct 24 ms 7996 KB Output is correct
40 Correct 23 ms 7996 KB Output is correct
41 Correct 24 ms 7924 KB Output is correct
42 Correct 0 ms 204 KB Output is correct
43 Correct 0 ms 204 KB Output is correct
44 Correct 0 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 0 ms 204 KB Output is correct
48 Correct 1 ms 204 KB Output is correct
49 Correct 0 ms 204 KB Output is correct
50 Correct 1 ms 204 KB Output is correct
51 Correct 1 ms 2252 KB Output is correct
52 Correct 1 ms 1740 KB Output is correct
53 Correct 1 ms 1612 KB Output is correct
54 Correct 3 ms 2540 KB Output is correct
55 Correct 1 ms 2124 KB Output is correct
56 Correct 2 ms 2380 KB Output is correct
57 Correct 0 ms 332 KB Output is correct
58 Correct 1 ms 1996 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 2 ms 2536 KB Output is correct
61 Correct 1 ms 2380 KB Output is correct
62 Correct 1 ms 204 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 332 KB Output is correct
66 Correct 1 ms 332 KB Output is correct
67 Correct 0 ms 332 KB Output is correct
68 Correct 2 ms 2636 KB Output is correct
69 Correct 2 ms 2636 KB Output is correct
70 Correct 2 ms 2636 KB Output is correct
71 Correct 2 ms 2636 KB Output is correct
72 Correct 2 ms 2636 KB Output is correct
73 Correct 2 ms 2636 KB Output is correct
74 Correct 3 ms 2636 KB Output is correct
75 Correct 1 ms 332 KB Output is correct
76 Correct 2 ms 2636 KB Output is correct
77 Correct 1 ms 332 KB Output is correct
78 Correct 2 ms 2636 KB Output is correct
79 Correct 1 ms 332 KB Output is correct
80 Correct 1 ms 460 KB Output is correct
81 Correct 1 ms 332 KB Output is correct
82 Correct 1 ms 460 KB Output is correct
83 Correct 1 ms 460 KB Output is correct
84 Correct 1 ms 460 KB Output is correct
85 Correct 3 ms 2508 KB Output is correct
86 Correct 3 ms 2124 KB Output is correct
87 Correct 4 ms 1868 KB Output is correct
88 Correct 2 ms 1996 KB Output is correct
89 Correct 3 ms 2252 KB Output is correct
90 Correct 3 ms 2764 KB Output is correct
91 Correct 18 ms 4564 KB Output is correct
92 Correct 18 ms 5324 KB Output is correct
93 Correct 26 ms 6016 KB Output is correct
94 Correct 1 ms 716 KB Output is correct
95 Correct 1 ms 716 KB Output is correct
96 Correct 1 ms 716 KB Output is correct
97 Correct 1 ms 716 KB Output is correct
98 Correct 1 ms 716 KB Output is correct
99 Correct 3 ms 2892 KB Output is correct
100 Correct 3 ms 2892 KB Output is correct
101 Correct 3 ms 2892 KB Output is correct
102 Correct 4 ms 2892 KB Output is correct
103 Correct 4 ms 2892 KB Output is correct
104 Correct 3 ms 2892 KB Output is correct
105 Correct 26 ms 6396 KB Output is correct
106 Correct 26 ms 6272 KB Output is correct
107 Correct 28 ms 6304 KB Output is correct
108 Correct 4 ms 1868 KB Output is correct
109 Correct 68 ms 36248 KB Output is correct
110 Correct 57 ms 19900 KB Output is correct
111 Correct 58 ms 14876 KB Output is correct
112 Correct 75 ms 17180 KB Output is correct
113 Correct 50 ms 11584 KB Output is correct
114 Correct 12 ms 4556 KB Output is correct
115 Correct 14 ms 4172 KB Output is correct
116 Correct 15 ms 5212 KB Output is correct
117 Correct 12 ms 3776 KB Output is correct
118 Correct 14 ms 4556 KB Output is correct
119 Correct 12 ms 4536 KB Output is correct
120 Correct 17 ms 4176 KB Output is correct
121 Correct 6 ms 1868 KB Output is correct
122 Correct 20 ms 4172 KB Output is correct
123 Correct 5 ms 1800 KB Output is correct
124 Correct 24 ms 5236 KB Output is correct
125 Correct 9 ms 2764 KB Output is correct
126 Correct 7 ms 3276 KB Output is correct
127 Correct 9 ms 4252 KB Output is correct
128 Correct 7 ms 3532 KB Output is correct
129 Correct 7 ms 3020 KB Output is correct
130 Correct 4 ms 1868 KB Output is correct
131 Correct 92 ms 51052 KB Output is correct
132 Correct 115 ms 36224 KB Output is correct
133 Correct 116 ms 29892 KB Output is correct
134 Correct 113 ms 26020 KB Output is correct
135 Correct 103 ms 23372 KB Output is correct
136 Correct 19 ms 5708 KB Output is correct
137 Correct 18 ms 5616 KB Output is correct
138 Correct 17 ms 5708 KB Output is correct
139 Correct 18 ms 5620 KB Output is correct
140 Correct 17 ms 5632 KB Output is correct
141 Correct 18 ms 5624 KB Output is correct
142 Correct 29 ms 6564 KB Output is correct
143 Correct 9 ms 3020 KB Output is correct
144 Correct 29 ms 6628 KB Output is correct
145 Correct 10 ms 3020 KB Output is correct
146 Correct 29 ms 6548 KB Output is correct
147 Correct 9 ms 3020 KB Output is correct
148 Correct 10 ms 4940 KB Output is correct
149 Correct 10 ms 4924 KB Output is correct
150 Correct 11 ms 4812 KB Output is correct
151 Correct 10 ms 4812 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 0 ms 332 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 2 ms 2636 KB Output is correct
16 Correct 2 ms 2636 KB Output is correct
17 Correct 2 ms 2636 KB Output is correct
18 Correct 2 ms 2636 KB Output is correct
19 Correct 2 ms 2636 KB Output is correct
20 Correct 1 ms 2636 KB Output is correct
21 Correct 2 ms 2636 KB Output is correct
22 Correct 2 ms 2636 KB Output is correct
23 Correct 2 ms 2636 KB Output is correct
24 Correct 21 ms 6604 KB Output is correct
25 Correct 23 ms 6604 KB Output is correct
26 Correct 25 ms 6508 KB Output is correct
27 Correct 4 ms 1868 KB Output is correct
28 Correct 4 ms 1868 KB Output is correct
29 Correct 5 ms 1740 KB Output is correct
30 Correct 4 ms 1612 KB Output is correct
31 Correct 4 ms 1612 KB Output is correct
32 Correct 3 ms 1528 KB Output is correct
33 Correct 10 ms 5148 KB Output is correct
34 Correct 10 ms 5196 KB Output is correct
35 Correct 10 ms 5196 KB Output is correct
36 Correct 10 ms 5100 KB Output is correct
37 Correct 11 ms 5196 KB Output is correct
38 Correct 9 ms 5200 KB Output is correct
39 Correct 24 ms 7996 KB Output is correct
40 Correct 23 ms 7996 KB Output is correct
41 Correct 24 ms 7924 KB Output is correct
42 Correct 17 ms 7152 KB Output is correct
43 Correct 10 ms 4424 KB Output is correct
44 Correct 17 ms 7364 KB Output is correct
45 Correct 12 ms 4708 KB Output is correct
46 Correct 11 ms 4172 KB Output is correct
47 Correct 17 ms 6840 KB Output is correct
48 Correct 56 ms 17184 KB Output is correct
49 Correct 29 ms 10948 KB Output is correct
50 Correct 36 ms 13160 KB Output is correct
51 Correct 39 ms 13504 KB Output is correct
52 Correct 41 ms 13652 KB Output is correct
53 Correct 33 ms 11368 KB Output is correct
54 Correct 18 ms 7732 KB Output is correct
55 Correct 19 ms 7628 KB Output is correct
56 Correct 18 ms 7480 KB Output is correct
57 Correct 18 ms 7132 KB Output is correct
58 Correct 18 ms 6860 KB Output is correct
59 Correct 16 ms 6860 KB Output is correct
60 Correct 53 ms 18716 KB Output is correct
61 Correct 52 ms 18800 KB Output is correct
62 Correct 54 ms 18748 KB Output is correct
63 Correct 56 ms 18748 KB Output is correct
64 Correct 58 ms 18796 KB Output is correct
65 Correct 54 ms 18720 KB Output is correct
66 Correct 55 ms 17476 KB Output is correct
67 Correct 52 ms 17396 KB Output is correct
68 Correct 54 ms 17440 KB Output is correct
69 Correct 0 ms 204 KB Output is correct
70 Correct 0 ms 204 KB Output is correct
71 Correct 0 ms 204 KB Output is correct
72 Correct 1 ms 204 KB Output is correct
73 Correct 1 ms 332 KB Output is correct
74 Correct 0 ms 204 KB Output is correct
75 Correct 1 ms 204 KB Output is correct
76 Correct 0 ms 204 KB Output is correct
77 Correct 1 ms 204 KB Output is correct
78 Correct 1 ms 2252 KB Output is correct
79 Correct 1 ms 1740 KB Output is correct
80 Correct 1 ms 1612 KB Output is correct
81 Correct 3 ms 2540 KB Output is correct
82 Correct 1 ms 2124 KB Output is correct
83 Correct 2 ms 2380 KB Output is correct
84 Correct 0 ms 332 KB Output is correct
85 Correct 1 ms 1996 KB Output is correct
86 Correct 1 ms 332 KB Output is correct
87 Correct 2 ms 2536 KB Output is correct
88 Correct 1 ms 2380 KB Output is correct
89 Correct 1 ms 204 KB Output is correct
90 Correct 1 ms 332 KB Output is correct
91 Correct 1 ms 332 KB Output is correct
92 Correct 1 ms 332 KB Output is correct
93 Correct 1 ms 332 KB Output is correct
94 Correct 0 ms 332 KB Output is correct
95 Correct 2 ms 2636 KB Output is correct
96 Correct 2 ms 2636 KB Output is correct
97 Correct 2 ms 2636 KB Output is correct
98 Correct 2 ms 2636 KB Output is correct
99 Correct 2 ms 2636 KB Output is correct
100 Correct 2 ms 2636 KB Output is correct
101 Correct 3 ms 2636 KB Output is correct
102 Correct 1 ms 332 KB Output is correct
103 Correct 2 ms 2636 KB Output is correct
104 Correct 1 ms 332 KB Output is correct
105 Correct 2 ms 2636 KB Output is correct
106 Correct 1 ms 332 KB Output is correct
107 Correct 1 ms 460 KB Output is correct
108 Correct 1 ms 332 KB Output is correct
109 Correct 1 ms 460 KB Output is correct
110 Correct 1 ms 460 KB Output is correct
111 Correct 1 ms 460 KB Output is correct
112 Correct 3 ms 2508 KB Output is correct
113 Correct 3 ms 2124 KB Output is correct
114 Correct 4 ms 1868 KB Output is correct
115 Correct 2 ms 1996 KB Output is correct
116 Correct 3 ms 2252 KB Output is correct
117 Correct 3 ms 2764 KB Output is correct
118 Correct 18 ms 4564 KB Output is correct
119 Correct 18 ms 5324 KB Output is correct
120 Correct 26 ms 6016 KB Output is correct
121 Correct 1 ms 716 KB Output is correct
122 Correct 1 ms 716 KB Output is correct
123 Correct 1 ms 716 KB Output is correct
124 Correct 1 ms 716 KB Output is correct
125 Correct 1 ms 716 KB Output is correct
126 Correct 3 ms 2892 KB Output is correct
127 Correct 3 ms 2892 KB Output is correct
128 Correct 3 ms 2892 KB Output is correct
129 Correct 4 ms 2892 KB Output is correct
130 Correct 4 ms 2892 KB Output is correct
131 Correct 3 ms 2892 KB Output is correct
132 Correct 26 ms 6396 KB Output is correct
133 Correct 26 ms 6272 KB Output is correct
134 Correct 28 ms 6304 KB Output is correct
135 Correct 4 ms 1868 KB Output is correct
136 Correct 68 ms 36248 KB Output is correct
137 Correct 57 ms 19900 KB Output is correct
138 Correct 58 ms 14876 KB Output is correct
139 Correct 75 ms 17180 KB Output is correct
140 Correct 50 ms 11584 KB Output is correct
141 Correct 12 ms 4556 KB Output is correct
142 Correct 14 ms 4172 KB Output is correct
143 Correct 15 ms 5212 KB Output is correct
144 Correct 12 ms 3776 KB Output is correct
145 Correct 14 ms 4556 KB Output is correct
146 Correct 12 ms 4536 KB Output is correct
147 Correct 17 ms 4176 KB Output is correct
148 Correct 6 ms 1868 KB Output is correct
149 Correct 20 ms 4172 KB Output is correct
150 Correct 5 ms 1800 KB Output is correct
151 Correct 24 ms 5236 KB Output is correct
152 Correct 9 ms 2764 KB Output is correct
153 Correct 7 ms 3276 KB Output is correct
154 Correct 9 ms 4252 KB Output is correct
155 Correct 7 ms 3532 KB Output is correct
156 Correct 7 ms 3020 KB Output is correct
157 Correct 4 ms 1868 KB Output is correct
158 Correct 92 ms 51052 KB Output is correct
159 Correct 115 ms 36224 KB Output is correct
160 Correct 116 ms 29892 KB Output is correct
161 Correct 113 ms 26020 KB Output is correct
162 Correct 103 ms 23372 KB Output is correct
163 Correct 19 ms 5708 KB Output is correct
164 Correct 18 ms 5616 KB Output is correct
165 Correct 17 ms 5708 KB Output is correct
166 Correct 18 ms 5620 KB Output is correct
167 Correct 17 ms 5632 KB Output is correct
168 Correct 18 ms 5624 KB Output is correct
169 Correct 29 ms 6564 KB Output is correct
170 Correct 9 ms 3020 KB Output is correct
171 Correct 29 ms 6628 KB Output is correct
172 Correct 10 ms 3020 KB Output is correct
173 Correct 29 ms 6548 KB Output is correct
174 Correct 9 ms 3020 KB Output is correct
175 Correct 10 ms 4940 KB Output is correct
176 Correct 10 ms 4924 KB Output is correct
177 Correct 11 ms 4812 KB Output is correct
178 Correct 10 ms 4812 KB Output is correct
179 Correct 11 ms 4816 KB Output is correct
180 Correct 184 ms 101956 KB Output is correct
181 Correct 326 ms 114304 KB Output is correct
182 Correct 532 ms 143036 KB Output is correct
183 Correct 287 ms 72600 KB Output is correct
184 Correct 245 ms 60064 KB Output is correct
185 Correct 32 ms 9296 KB Output is correct
186 Correct 32 ms 11752 KB Output is correct
187 Correct 37 ms 10980 KB Output is correct
188 Correct 28 ms 6500 KB Output is correct
189 Correct 41 ms 12736 KB Output is correct
190 Correct 32 ms 7072 KB Output is correct
191 Correct 39 ms 12352 KB Output is correct
192 Correct 21 ms 5700 KB Output is correct
193 Correct 30 ms 9284 KB Output is correct
194 Correct 20 ms 7884 KB Output is correct
195 Correct 450 ms 253996 KB Output is correct
196 Correct 524 ms 180164 KB Output is correct
197 Correct 540 ms 148292 KB Output is correct
198 Correct 520 ms 128912 KB Output is correct
199 Correct 476 ms 115660 KB Output is correct
200 Correct 69 ms 20564 KB Output is correct
201 Correct 77 ms 20620 KB Output is correct
202 Correct 70 ms 20632 KB Output is correct
203 Correct 70 ms 20540 KB Output is correct
204 Correct 72 ms 20632 KB Output is correct
205 Correct 74 ms 20508 KB Output is correct
206 Correct 47 ms 13124 KB Output is correct
207 Correct 55 ms 18788 KB Output is correct
208 Correct 51 ms 13092 KB Output is correct
209 Correct 54 ms 18900 KB Output is correct
210 Correct 49 ms 13072 KB Output is correct
211 Correct 54 ms 18844 KB Output is correct
212 Correct 62 ms 19892 KB Output is correct
213 Correct 54 ms 16728 KB Output is correct
214 Correct 54 ms 16248 KB Output is correct
215 Correct 54 ms 16120 KB Output is correct