QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#204662#7566. Interval Additionucup-team112#AC ✓716ms265396kbC++2011.8kb2023-10-07 13:36:382023-10-07 13:36:39

Judging History

你现在查看的是最新测评结果

  • [2023-10-07 13:36:39]
  • 评测
  • 测评结果:AC
  • 用时:716ms
  • 内存:265396kb
  • [2023-10-07 13:36:38]
  • 提交

answer

//#define _GLIBCXX_DEBUG

//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")

#include<bits/stdc++.h>
using namespace std;


#ifdef LOCAL
#include <debug_print.hpp>
#define OUT(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define OUT(...) (static_cast<void>(0))
#endif

#define endl '\n'
#define lfs cout<<fixed<<setprecision(15)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define UNIQUE(a) (a).erase(unique((a).begin(),(a).end()),(a).end())
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (ll)(m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T> using PQ = priority_queue<T>;
template<typename T> using QP = priority_queue<T,vector<T>,greater<T>>;
template<typename T1, typename T2>bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
template<typename T1, typename T2>bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T1,typename T2,typename T3>void anss(T1 x,T2 y,T3 z){ans(x!=y,x,z);};  
template<typename T>void debug(const T &v,ll h,ll w,string sv=" "){for(ll i=0;i<h;i++){cout<<v[i][0];for(ll j=1;j<w;j++)cout<<sv<<v[i][j];cout<<endl;}};
template<typename T>void debug(const T &v,ll n,string sv=" "){if(n!=0)cout<<v[0];for(ll i=1;i<n;i++)cout<<sv<<v[i];cout<<endl;};
template<typename T>void debug(const vector<T>&v){debug(v,v.size());}
template<typename T>void debug(const vector<vector<T>>&v){for(auto &vv:v)debug(vv,vv.size());}
template<typename T>void debug(stack<T> st){while(!st.empty()){cout<<st.top()<<" ";st.pop();}cout<<endl;}
template<typename T>void debug(queue<T> st){while(!st.empty()){cout<<st.front()<<" ";st.pop();}cout<<endl;}
template<typename T>void debug(deque<T> st){while(!st.empty()){cout<<st.front()<<" ";st.pop_front();}cout<<endl;}
template<typename T>void debug(PQ<T> st){while(!st.empty()){cout<<st.top()<<" ";st.pop();}cout<<endl;}
template<typename T>void debug(QP<T> st){while(!st.empty()){cout<<st.top()<<" ";st.pop();}cout<<endl;}
template<typename T>void debug(const set<T>&v){for(auto z:v)cout<<z<<" ";cout<<endl;}
template<typename T>void debug(const multiset<T>&v){for(auto z:v)cout<<z<<" ";cout<<endl;}
template<typename T,size_t size>void debug(const array<T, size> &a){for(auto z:a)cout<<z<<" ";cout<<endl;}
template<typename T,typename V>void debug(const map<T,V>&v){for(auto z:v)cout<<"["<<z.first<<"]="<<z.second<<",";cout<<endl;}
template<typename T>vector<vector<T>>vec(ll x, ll y, T w){vector<vector<T>>v(x,vector<T>(y,w));return v;}
vector<ll>dx={1,-1,0,0,1,1,-1,-1};vector<ll>dy={0,0,1,-1,1,-1,1,-1};
template<typename T>vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v(ts...))>(a,make_v(ts...));}
template<typename T1, typename T2>ostream &operator<<(ostream &os, const pair<T1, T2>&p){return os << "(" << p.first << "," << p.second << ")";}
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v){os<<"[";for(auto &z:v)os << z << ",";os<<"]"; return os;}
template<typename T>void rearrange(vector<int>&ord, vector<T>&v){
  auto tmp = v;
  for(int i=0;i<tmp.size();i++)v[i] = tmp[ord[i]];
}
template<typename Head, typename... Tail>void rearrange(vector<int>&ord,Head&& head, Tail&&... tail){
  rearrange(ord, head);
  rearrange(ord, tail...);
}
template<typename T> vector<int> ascend(const vector<T>&v){
  vector<int>ord(v.size());iota(ord.begin(),ord.end(),0);
  sort(ord.begin(),ord.end(),[&](int i,int j){return make_pair(v[i],i)<make_pair(v[j],j);});
  return ord;
}
template<typename T> vector<int> descend(const vector<T>&v){
  vector<int>ord(v.size());iota(ord.begin(),ord.end(),0);
  sort(ord.begin(),ord.end(),[&](int i,int j){return make_pair(v[i],-i)>make_pair(v[j],-j);});
  return ord;
}
template<typename T> vector<T> inv_perm(const vector<T>&ord){
  vector<T>inv(ord.size());
  for(int i=0;i<ord.size();i++)inv[ord[i]] = i;
  return inv;
}
ll FLOOR(ll n,ll div){assert(div>0);return n>=0?n/div:(n-div+1)/div;}
ll CEIL(ll n,ll div){assert(div>0);return n>=0?(n+div-1)/div:n/div;}
ll digitsum(ll n){ll ret=0;while(n){ret+=n%10;n/=10;}return ret;}
ll modulo(ll n,ll d){return (n%d+d)%d;};
template<typename T>T min(const vector<T>&v){return *min_element(v.begin(),v.end());}
template<typename T>T max(const vector<T>&v){return *max_element(v.begin(),v.end());}
template<typename T>T acc(const vector<T>&v){return accumulate(v.begin(),v.end(),T(0));};
template<typename T>T reverse(const T &v){return T(v.rbegin(),v.rend());};
//mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
int popcount(ll x){return __builtin_popcountll(x);};
int poplow(ll x){return __builtin_ctzll(x);};
int pophigh(ll x){return 63 - __builtin_clzll(x);};
template<typename T>T poll(queue<T> &q){auto ret=q.front();q.pop();return ret;};
template<typename T>T poll(priority_queue<T> &q){auto ret=q.top();q.pop();return ret;};
template<typename T>T poll(QP<T> &q){auto ret=q.top();q.pop();return ret;};
template<typename T>T poll(stack<T> &s){auto ret=s.top();s.pop();return ret;};
ll MULT(ll x,ll y){if(LLONG_MAX/x<=y)return LLONG_MAX;return x*y;}
ll POW2(ll x, ll k){ll ret=1,mul=x;while(k){if(mul==LLONG_MAX)return LLONG_MAX;if(k&1)ret=MULT(ret,mul);mul=MULT(mul,mul);k>>=1;}return ret;}
ll POW(ll x, ll k){ll ret=1;for(int i=0;i<k;i++){if(LLONG_MAX/x<=ret)return LLONG_MAX;ret*=x;}return ret;}
namespace converter{
  int dict[500];
  const string lower="abcdefghijklmnopqrstuvwxyz";
  const string upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  const string digit="0123456789";
  const string digit1="123456789";
  void regi_str(const string &t){
    for(int i=0;i<t.size();i++){
      dict[t[i]]=i;
    }
  }
  void regi_int(const string &t){
    for(int i=0;i<t.size();i++){
      dict[i]=t[i];
    }
  }
  vector<int>to_int(const string &s,const string &t){
    regi_str(t);
    vector<int>ret(s.size());
    for(int i=0;i<s.size();i++){
      ret[i]=dict[s[i]];
    }
    return ret;
  }
  vector<int>to_int(const string &s){
    auto t=s;
    sort(t.begin(),t.end());
    t.erase(unique(t.begin(),t.end()),t.end());
    return to_int(s,t);
  }
  
  vector<vector<int>>to_int(const vector<string>&s,const string &t){
    regi_str(t);
    vector<vector<int>>ret(s.size(),vector<int>(s[0].size()));
    for(int i=0;i<s.size();i++){
      for(int j=0;j<s[0].size();j++){
        ret[i][j]=dict[s[i][j]];
      }
    }
    return ret;
  }
  vector<vector<int>>to_int(const vector<string>&s){
    string t;
    for(int i=0;i<s.size();i++){
      t+=s[i];
    }
    sort(t.begin(),t.end());t.erase(unique(t.begin(),t.end()),t.end());
    return to_int(s,t);
  }
  string to_str(const vector<int>&s,const string &t){
    regi_int(t);
    string ret;
    for(auto z:s)ret+=dict[z];
    return ret;
  }
  vector<string> to_str(const vector<vector<int>>&s,const string &t){
    regi_int(t);
    vector<string>ret(s.size());
    for(int i=0;i<s.size();i++){
      for(auto z:s[i])ret[i]+=dict[z];
    }
    return ret;
  }
}
template< typename T = int >
struct edge {
  int to;
  T cost;
  int id;
  edge():to(-1),id(-1){};
  edge(int to, T cost = 1, int id = -1):to(to), cost(cost), id(id){}
  operator int() const { return to; }
};

template<typename T>
using Graph = vector<vector<edge<T>>>;
template<typename T>
Graph<T>revgraph(const Graph<T> &g){
  Graph<T>ret(g.size());
  for(int i=0;i<g.size();i++){
    for(auto e:g[i]){
      int to = e.to;
      e.to = i;
      ret[to].push_back(e);
    }
  }
  return ret;
}
template<typename T>
Graph<T> readGraph(int n,int m,int indexed=1,bool directed=false,bool weighted=false){
  Graph<T> ret(n);
  for(int es = 0; es < m; es++){
    int u,v;
    T w=1;
    cin>>u>>v;u-=indexed,v-=indexed;
    if(weighted)cin>>w;
    ret[u].emplace_back(v,w,es);
    if(!directed)ret[v].emplace_back(u,w,es);
  }
  return ret;
}
template<typename T>
Graph<T> readParent(int n,int indexed=1,bool directed=true){
  Graph<T>ret(n);
  for(int i=1;i<n;i++){
    int p;cin>>p;
    p-=indexed;
    ret[p].emplace_back(i);
    if(!directed)ret[i].emplace_back(p);
  }
  return ret;
}
namespace BitConvolution{
  template<typename T>
  vector<T> or_zeta(const vector<T> &v){
    vector<T> ret = v;
    for(int i = 1; i < v.size(); i <<= 1){
      for(int j = 0; j < v.size(); j++){
        if(i & j)ret[j] += ret[j^i];
      }
    }
    return ret;
  }
  template<typename T>
  vector<T> or_meb(const vector<T> &v){
    vector<T> ret = v;
    for(int i = 1; i < v.size(); i <<= 1){
      for(int j = 0; j < v.size(); j++){
        if(i & j)ret[j] -= ret[j^i];
      }
    }
    return ret;
  }
  template<typename T>
  vector<T> and_zeta(const vector<T> &v){
    vector<T> ret = v;
    for(int i = 1; i < v.size(); i <<= 1){
      for(int j = 0; j < v.size(); j++){
        if(i & j)ret[j^i] += ret[j];
      }
    }
    return ret;
  }
  template<typename T>
  vector<T> or_conv(const vector<T> &a, const vector<T> &b){
    auto az = or_zeta(a);
    auto bz = or_zeta(b);
    for(int i = 0; i < az.size(); i++){
      az[i] *= bz[i];
    }
    return or_meb(az);
  }
  template<typename T>
  vector<T> and_meb(const vector<T> &v){
    vector<T> ret = v;
    for(int i = 1; i < v.size(); i <<= 1){
      for(int j = 0; j < v.size(); j++){
        if(i & j)ret[j^i] -= ret[j];
      }
    }
    return ret;
  }
  template<typename T>
  vector<T> xor_zeta(const vector<T> &v){
    vector<T> ret = v;
    for(int i = 1; i < v.size(); i <<= 1){
      for(int j = 0; j < v.size(); j++){
        if((i & j) == 0){
          T x = ret[j], y = ret[j | i];
          ret[j] = x + y, ret[j | i] = x - y;
        }
      }
    }
    return ret;
  }
  template<typename T>
  vector<T> and_conv(const vector<T> &a, const vector<T> &b){
    auto az = and_zeta(a);
    auto bz = and_zeta(b);
    for(int i = 0; i < az.size(); i++){
      az[i] *= bz[i];
    }
    return and_meb(az);
  }
  template<typename T>
  vector<T> xor_meb(const vector<T> &v){
    vector<T> ret = v;
    for(int i = 1; i < v.size(); i <<= 1){
      for(int j = 0; j < v.size(); j++){
        if((i & j) == 0){
          T x = ret[j], y = ret[j | i];
          ret[j] = (x + y) >> 1, ret[j | i] = (x - y) >> 1;
        }
      }
    }
    return ret;
  }
  template<typename T>
  vector<T> xor_conv(const vector<T> &a, const vector<T> &b){
    auto az = xor_zeta(a);
    auto bz = xor_zeta(b);
    for(int i = 0; i < az.size(); i++){
      az[i] *= bz[i];
    }
    return xor_meb(az);
  }
};
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  int n;cin>>n;
  vector<ll>a(n);
  rep(i,0,n)cin>>a[i];
  vector<ll>b(n+1);
  b[0]=a[0];
  b[n]=-a[n-1];
  rep(i,0,n-1)b[i+1]=a[i+1]-a[i];
  n++;
  vector<ll>c(1<<n);
  rep(i,0,n){
    c[1<<i]+=b[i];
  }
  c=BitConvolution::or_zeta(c);
  //OUT(c);
  vector<ll>dp(1<<n,0);
  dp[0]=0;
  rep(i,0,1<<n){
    if(c[i]==0)dp[i]++;
    rep(j,0,n){
      chmax(dp[i|1<<j],dp[i]);
    }
  }
  //OUT(dp);
  cout<<n-max(dp)+1<<endl;
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3488kb

input:

5
1 2 3 2 1

output:

3

result:

ok 1 number(s): "3"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3500kb

input:

6
1 1 4 5 1 4

output:

4

result:

ok 1 number(s): "4"

Test #3:

score: 0
Accepted
time: 639ms
memory: 265336kb

input:

23
154867764 88416234 958556716 525347353 297126571 748390457 991684429 346718178 898503520 361211695 769645122 37543644 545129269 108357111 477091071 990326512 89442247 500865905 865261751 881423606 884862773 342044622 545846884

output:

23

result:

ok 1 number(s): "23"

Test #4:

score: 0
Accepted
time: 672ms
memory: 265304kb

input:

23
120512728 488581138 644845116 520600533 100830035 819227263 160270658 973159498 726973004 621205731 645066544 284705591 139812862 771961411 928673722 774153929 872014266 753699081 71306808 6052789 859500856 467237467 917534614

output:

23

result:

ok 1 number(s): "23"

Test #5:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

10
625630902 579967568 160371090 238722458 707634839 237285041 459491010 454916131 608704408 709619323

output:

10

result:

ok 1 number(s): "10"

Test #6:

score: 0
Accepted
time: 1ms
memory: 3488kb

input:

1
46422493

output:

1

result:

ok 1 number(s): "1"

Test #7:

score: 0
Accepted
time: 651ms
memory: 265392kb

input:

23
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 499999953 499999953 499999953 499999953 499999953 499999953 499999953 499999953 500000000 500000000 500000000 500000000 500000000 500000000 500000000

output:

2

result:

ok 1 number(s): "2"

Test #8:

score: 0
Accepted
time: 661ms
memory: 265328kb

input:

23
500000011 500000011 500000026 500000026 500000026 500000026 500000026 500000026 500000026 500000045 500000045 500000015 500000015 500000015 500000015 500000000 500000096 500000041 500000041 500000041 500000096 500000096 500000000

output:

6

result:

ok 1 number(s): "6"

Test #9:

score: 0
Accepted
time: 667ms
memory: 265352kb

input:

23
500000000 500000000 500000066 500000073 500000073 500000182 500000182 500000087 500000169 500000169 500000133 500000133 500000035 500000035 499999871 499999865 499999865 499999865 500000154 500000072 500000072 500000096 500000000

output:

11

result:

ok 1 number(s): "11"

Test #10:

score: 0
Accepted
time: 716ms
memory: 265300kb

input:

23
499999858 499999791 499999811 499999854 499999847 499999769 499999893 499999791 499999757 499999924 500000215 500000063 499999986 500000146 499999907 500000007 499999789 499999985 499999874 499999884 500000008 499999922 499999917

output:

19

result:

ok 1 number(s): "19"

Test #11:

score: 0
Accepted
time: 653ms
memory: 265368kb

input:

23
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500006627 500006627 500006627 500006627 500006627 500006627 500006627 500006627 500000000 500000000

output:

2

result:

ok 1 number(s): "2"

Test #12:

score: 0
Accepted
time: 675ms
memory: 265396kb

input:

23
500000000 499991668 499991668 499991668 499991668 499991668 499992421 499992421 499992421 499992421 499992421 499992421 499992421 499991701 499991701 500007356 500007323 500007323 500007323 500007323 500007323 500007323 500006700

output:

6

result:

ok 1 number(s): "6"

Test #13:

score: 0
Accepted
time: 662ms
memory: 265328kb

input:

23
500008971 500007158 500007158 500007158 500007158 500007158 500016740 500016740 500023431 500029646 500031770 500025555 500025555 500025555 500025555 500020962 500011380 500014021 500011069 500012381 500009692 500005314 500005314

output:

11

result:

ok 1 number(s): "11"

Test #14:

score: 0
Accepted
time: 666ms
memory: 265312kb

input:

23
500004790 500011043 500001539 499988427 499989318 500002907 499992442 500000344 500013204 500032360 500022060 500005386 499989135 499995181 499970440 499974934 499970234 499985465 499988500 499997841 499978295 499995992 499985112

output:

21

result:

ok 1 number(s): "21"

Test #15:

score: 0
Accepted
time: 664ms
memory: 265392kb

input:

23
500000000 500000000 500775103 500775103 500775103 500775103 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000

output:

2

result:

ok 1 number(s): "2"

Test #16:

score: 0
Accepted
time: 685ms
memory: 265344kb

input:

23
500000000 500000000 500000000 499317985 499883344 499883344 499883344 499883344 499047944 499814976 499814976 499007908 498442549 498442549 498442549 499164600 499164600 499164600 499164600 500000000 500000000 500000000 500000000

output:

6

result:

ok 1 number(s): "6"

Test #17:

score: 0
Accepted
time: 660ms
memory: 265320kb

input:

23
500578170 501342629 500685333 500685333 500685333 500434440 500434440 500833302 500833302 500018930 500352528 500127753 500603421 501751304 501417793 500685333 500685333 499920874 500578170 500000000 500420306 500420306 500420306

output:

11

result:

ok 1 number(s): "11"

Test #18:

score: 0
Accepted
time: 632ms
memory: 265332kb

input:

23
501122407 505187190 506309930 504626086 504486924 505864777 505478791 504987294 506389246 504959954 503907177 503951359 504513755 503329719 502108244 500920912 502168527 499084052 499787444 501128474 502585881 500042621 498430594

output:

23

result:

ok 1 number(s): "23"

Test #19:

score: 0
Accepted
time: 673ms
memory: 265344kb

input:

23
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 499999978 499999978 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000

output:

2

result:

ok 1 number(s): "2"

Test #20:

score: 0
Accepted
time: 672ms
memory: 265344kb

input:

23
500000000 500000000 499999924 499999924 499999952 499999952 500000028 499999983 499999983 500000069 500000069 500000069 500000069 500000069 500000148 500000148 500000069 500000069 500000069 500000000 500000000 500000000 500000000

output:

6

result:

ok 1 number(s): "6"

Test #21:

score: 0
Accepted
time: 677ms
memory: 265364kb

input:

23
500000000 499999969 499999929 499999929 499999779 499999747 499999747 499999747 499999667 499999707 499999930 499999891 499999891 499999881 499999881 499999845 499999925 499999925 499999964 499999964 499999904 499999964 500000000

output:

10

result:

ok 1 number(s): "10"

Test #22:

score: 0
Accepted
time: 675ms
memory: 265348kb

input:

23
500000155 500000315 500000231 500000048 500000372 500000424 500000278 500000277 500000124 500000103 500000191 499999987 499999852 499999617 499999631 499999629 499999711 499999651 499999585 499999530 499999495 499999747 499999993

output:

19

result:

ok 1 number(s): "19"

Test #23:

score: 0
Accepted
time: 653ms
memory: 265364kb

input:

23
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000 500006119 500006119 500006119 500006119 500006119 500006119 500000000 500000000 500000000 500000000

output:

2

result:

ok 1 number(s): "2"

Test #24:

score: 0
Accepted
time: 707ms
memory: 265388kb

input:

23
500000000 499991623 499991623 499991623 499991623 499984295 499975156 499975156 499975156 499976321 499976321 499976321 499976321 499993837 499993837 499993837 500001165 500001165 500001165 500000000 500000936 500000936 500000936

output:

6

result:

ok 1 number(s): "6"

Test #25:

score: 0
Accepted
time: 698ms
memory: 265388kb

input:

23
500000000 500002755 500002755 500002067 500002067 500002067 500007059 500007132 500015950 500015950 500010958 499993925 499993925 499995224 499997138 500004895 500004895 499999276 499999276 499996521 500000841 500000841 500000000

output:

11

result:

ok 1 number(s): "11"

Test #26:

score: 0
Accepted
time: 665ms
memory: 265324kb

input:

23
500009706 500006191 499984915 500014440 500023321 500026011 500039936 500024527 500036349 500046344 500041663 500021759 500032357 500030712 500006508 500019971 500032469 500052348 500028446 500001617 500011492 500019408 500015211

output:

21

result:

ok 1 number(s): "21"

Test #27:

score: 0
Accepted
time: 671ms
memory: 265332kb

input:

23
500000000 500000000 500000000 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037 499207037

output:

2

result:

ok 1 number(s): "2"

Test #28:

score: 0
Accepted
time: 672ms
memory: 265332kb

input:

23
500000000 500000000 499906417 499906417 499004628 498250213 498250213 498250213 498250213 498250213 498250213 498250213 498326320 498326320 498326320 499004628 499004628 499004628 499098211 499098211 500000000 500000000 500000000

output:

5

result:

ok 1 number(s): "5"

Test #29:

score: 0
Accepted
time: 662ms
memory: 265388kb

input:

23
500000000 499433731 498421805 498421805 498210823 498006549 498006549 498006549 498006549 498587939 498661850 498661850 498291442 498291442 498388735 499246254 500160887 500160887 500903970 501108244 501674513 500857519 500000000

output:

10

result:

ok 1 number(s): "10"

Test #30:

score: 0
Accepted
time: 669ms
memory: 265392kb

input:

23
498848100 495902575 495746206 496218670 495979695 497212048 498148282 498317731 497827244 497356221 496914395 491578419 489374599 490446554 488473546 490054662 493713401 493738233 495454097 496961762 497102961 498246670 499168534

output:

23

result:

ok 1 number(s): "23"

Test #31:

score: 0
Accepted
time: 676ms
memory: 265360kb

input:

23
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 5 5 5

output:

1

result:

ok 1 number(s): "1"

Test #32:

score: 0
Accepted
time: 695ms
memory: 265344kb

input:

23
4 0 0 0 3 3 3 9 9 9 9 9 9 9 9 7 7 2 2 2 2 2 0

output:

5

result:

ok 1 number(s): "5"

Test #33:

score: 0
Accepted
time: 704ms
memory: 265360kb

input:

23
0 0 2 0 0 0 2 2 7 6 8 8 8 5 5 0 2 10 2 2 11 9 0

output:

8

result:

ok 1 number(s): "8"

Test #34:

score: 0
Accepted
time: 685ms
memory: 265336kb

input:

23
0 0 0 0 0 58 58 58 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

output:

1

result:

ok 1 number(s): "1"

Test #35:

score: 0
Accepted
time: 679ms
memory: 265368kb

input:

23
0 0 0 0 0 0 0 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0 0

output:

1

result:

ok 1 number(s): "1"

Test #36:

score: 0
Accepted
time: 691ms
memory: 265388kb

input:

23
0 26 0 0 0 0 12 12 0 17 17 25 25 25 49 0 0 21 0 0 0 0 0

output:

6

result:

ok 1 number(s): "6"

Test #37:

score: 0
Accepted
time: 674ms
memory: 265388kb

input:

23
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 387 387 387 387 387 387

output:

1

result:

ok 1 number(s): "1"

Test #38:

score: 0
Accepted
time: 696ms
memory: 265348kb

input:

23
0 0 0 0 0 0 0 0 0 471 471 471 0 0 0 0 0 255 255 0 0 0 0

output:

2

result:

ok 1 number(s): "2"

Test #39:

score: 0
Accepted
time: 681ms
memory: 265364kb

input:

23
0 39 39 39 0 0 0 0 0 0 0 0 0 0 56 618 618 0 507 507 0 0 0

output:

4

result:

ok 1 number(s): "4"

Test #40:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

12
500000000 500000000 500000000 500000000 500000000 500000000 500000000 499999925 499999925 499999925 500000000 500000000

output:

2

result:

ok 1 number(s): "2"

Test #41:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

12
500000068 500000068 500000068 500000068 500000236 500000236 500000348 500000280 500000280 500000252 500000178 500000094

output:

6

result:

ok 1 number(s): "6"

Test #42:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

12
500000036 500000036 500000094 500000091 500000071 500000180 500000139 500000139 500000081 500000052 500000052 500000066

output:

8

result:

ok 1 number(s): "8"

Test #43:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

12
500000275 499999911 499999869 499999727 499999605 499999420 499999573 499999445 499999454 499999592 499999536 499999675

output:

11

result:

ok 1 number(s): "11"

Test #44:

score: 0
Accepted
time: 0ms
memory: 3696kb

input:

12
500000000 500000000 500000000 500000000 500000000 500000000 500000000 499993913 499993913 500000000 500000000 500000000

output:

2

result:

ok 1 number(s): "2"

Test #45:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

12
500006067 500006067 500006067 499999092 499999092 500004693 499998027 499992426 499985213 499993025 500000000 500000000

output:

6

result:

ok 1 number(s): "6"

Test #46:

score: 0
Accepted
time: 1ms
memory: 3656kb

input:

12
500000693 500008328 499994319 499994319 499994319 499988701 499995255 499995255 499996495 500003850 499996215 499996814

output:

8

result:

ok 1 number(s): "8"

Test #47:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

12
499995758 500029554 500038100 500105274 500056969 500051722 500049028 500006103 500002095 500008779 500012816 500004278

output:

12

result:

ok 1 number(s): "12"

Test #48:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

12
500000000 500808447 500808447 500808447 500808447 500000000 500000000 500000000 500000000 500000000 500000000 500000000

output:

2

result:

ok 1 number(s): "2"

Test #49:

score: 0
Accepted
time: 1ms
memory: 3624kb

input:

12
499754295 499754295 499754295 499519818 500429969 500664446 500774079 501489727 500579576 500469943 500469943 500000000

output:

6

result:

ok 1 number(s): "6"

Test #50:

score: 0
Accepted
time: 1ms
memory: 3576kb

input:

12
499117991 498271666 499225658 499225658 499487368 500063644 499528612 500410621 501005234 500204419 499960542 499789532

output:

10

result:

ok 1 number(s): "10"

Test #51:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

12
501960621 504050777 504603727 504435368 501735026 502850106 501772052 498494818 494609715 495382734 496351255 499241585

output:

12

result:

ok 1 number(s): "12"

Test #52:

score: 0
Accepted
time: 674ms
memory: 265336kb

input:

23
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

output:

0

result:

ok 1 number(s): "0"