QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#538023 | #4565. Rarest Insects | Yahia_Emara | 0 | 23ms | 10292kb | C++20 | 3.0kb | 2024-08-30 20:59:17 | 2024-08-30 20:59:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define sz(x) int(x.size())
#define dbg(x) cout << (#x) << " : " << x << endl
#define pb push_back
#define bk(x) x.back()
#define all(x) x.begin(),x.end()
#define LOOP(n) for(int rp=0;rp<n;rp++)
#define sq(x) ((x)*(x))
typedef long long ll;
typedef long double dl;
const int SZ=5e5+7;
const ll INF=1e18+7;
const dl eps=1e-9;
int MOD=1e9+7;
mt19937_64 rng(time(0));
int rnd(int l,int r){
return uniform_int_distribution<int>(l,r)(rng);
}
ll trig(ll x){
return x*(x+1)/2;
}
int getN(){
int n;cin >> n;
return n;
}
#define cmbntrcs fact[0]=1;for(int i=1;i<SZ;i++)fact[i]=mul(fact[i-1],i);finv[SZ-1]=inv(fact[SZ-1]);for(int i=SZ-2;i>0;i--)finv[i]=mul(finv[i+1],i+1);
int fact[SZ],finv[SZ];
int add(int x,int y,int MOD=MOD){
x+=y;if(x>=MOD)x-=MOD;
return x;
}
int sub(int x,int y,int MOD=MOD){
x-=y;if(x<0)x+=MOD;
return x;
}
int mul(int x,int y,int MOD=MOD){
return(x*1ll*y)%MOD;
}
int pwr(int x,ll b,int MOD=MOD){
int rt=1;
while(b>0){
if(b&1)rt=mul(rt,x,MOD);
x=mul(x,x,MOD),b>>=1;
}
return rt;
}
int inv(int x,int MOD=MOD){
return pwr(x,MOD-2,MOD);
}
#include "insects.h"
//#include "stub.cpp"
int n,p[SZ],a[SZ],k,vs[SZ];
vector<int>v;
void ins(int i){
i=p[i];
vs[i]=1;
move_inside(i);
v.pb(i);
}
void dlt(){
vs[bk(v)]=0;
move_outside(bk(v));
v.pop_back();
}
void permdlt(){
vs[bk(v)]=2;
move_outside(bk(v));
v.pop_back();
}
int card(){
return press_button();
}
bool f(int C){
while(card()>C)dlt();
for(int i=0;i<n;i++){
if(vs[p[i]])continue;
ins(i);
if(card()>C)dlt();
}
if(C*k==sz(v))return 1;
return 0;
}
int min_cardinality(int N){
n=N;
for(int i=0;i<n;i++)p[i]=i;
for(int i=0;i<n;i++)swap(p[i],p[rnd(0,i)]);
for(int i=0;i<n;i++){
ins(i);
if(card()>1)dlt();
}
k=sz(v);
if(k==1)return n;
if(k<=6){
vector<int>w=v;
while(sz(v))dlt();
for(int i=0;i<k;i++)swap(w[i],w[rnd(0,i)]);
int C=0,ans=1e9;
for(int i=0;i<k-1;i++){
ins(w[i]);
for(int i=0;i<n;i++){
if(vs[p[i]])continue;
ins(i);
if(card()!=sz(v))dlt();
}
C+=sz(v),ans=min(ans,sz(v));
while(sz(v))permdlt();
}
ans=min(ans,n-C);
return ans;
}
for(int i=0;i<k;i++)swap(v[i],v[rnd(0,i)]);
while(sz(v)>1)dlt();
for(int i=0;i<n;i++){
if(vs[p[i]])continue;
ins(i);
if(card()!=sz(v))dlt();
}
int l=2,r=min(n/k,sz(v)),ans=1;
while(l<=r){
int md=(l+r)>>1;
if(f(md))l=md+1,ans=md;
else r=md-1;
}
return ans;
}
/*int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
//cout << fixed << setprecision(12);
int tt=1;
//cin >> tt;
LOOP(tt){
//code
}
return 0;
}*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 10
Accepted
time: 2ms
memory: 10012kb
input:
6 1 2 1 1 2 2 2 2 2 2 3 1 2
output:
8 0 4 8 2 8 0 2 8 2 8 1 2 8 0 1 8 2 8 0 3 8 2 8 0 0 8 2 8 1 0 8 0 5 8 2 8 1 5 8 1 3 8 1 1 8 1 4 8 0 2 8 0 4 8 2 8 0 1 8 2 8 1 1 8 0 3 8 2 8 1 3 8 0 0 8 2 8 1 0 8 0 5 8 2 8 1 5 8 1 4 8 1 2 8 0 0 8 0 1 8 2 8 1 1 8 0 3 8 2 8 1 3 8 1 0 8 3 1
result:
ok
Test #2:
score: 10
Accepted
time: 1ms
memory: 7956kb
input:
2 1 2
output:
8 0 0 8 2 8 0 1 8 2 8 1 1 8 3 2
result:
ok
Test #3:
score: 10
Accepted
time: 0ms
memory: 10072kb
input:
2 1 1 1
output:
8 0 0 8 2 8 0 1 8 2 8 1 1 8 1 0 8 0 0 8 0 1 8 2 8 1 1 8 1 0 8 3 1
result:
ok
Test #4:
score: 10
Accepted
time: 0ms
memory: 9944kb
input:
3 1 1 2 1 2
output:
8 0 0 8 2 8 0 2 8 2 8 0 1 8 2 8 1 1 8 1 2 8 1 0 8 0 1 8 0 0 8 2 8 1 0 8 0 2 8 2 8 1 2 8 1 1 8 3 1
result:
ok
Test #5:
score: 10
Accepted
time: 1ms
memory: 9936kb
input:
5 1 1 2 2 2 1 2 2 2
output:
8 0 4 8 2 8 0 2 8 2 8 0 1 8 2 8 1 1 8 0 3 8 2 8 1 3 8 0 0 8 2 8 1 0 8 1 2 8 1 4 8 0 1 8 0 4 8 2 8 1 4 8 0 2 8 2 8 0 3 8 2 8 1 3 8 0 0 8 2 8 1 0 8 1 2 8 1 1 8 3 2
result:
ok
Test #6:
score: 10
Accepted
time: 2ms
memory: 10080kb
input:
8 1 2 1 1 2 2 2 2 1 1 2 2 2 2 2 2 3 3 4 5
output:
8 0 4 8 2 8 0 2 8 2 8 1 2 8 0 6 8 2 8 0 7 8 2 8 0 0 8 2 8 1 0 8 0 5 8 2 8 1 5 8 0 1 8 2 8 1 1 8 0 3 8 2 8 1 3 8 1 7 8 1 6 8 1 4 8 0 0 8 0 4 8 2 8 1 4 8 0 2 8 2 8 1 2 8 0 6 8 2 8 0 7 8 2 8 1 7 8 0 5 8 2 8 1 5 8 0 1 8 2 8 1 1 8 0 3 8 2 8 1 3 8 1 6 8 1 0 8 0 3 8 0 4 8 2 8 0 2 8 2 8 0 7 8 2 8 1 7 8 0 5 ...
result:
ok
Test #7:
score: 10
Accepted
time: 0ms
memory: 9992kb
input:
199 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
output:
8 0 63 8 2 8 0 55 8 2 8 1 55 8 0 86 8 2 8 1 86 8 0 96 8 2 8 1 96 8 0 108 8 2 8 1 108 8 0 117 8 2 8 1 117 8 0 33 8 2 8 1 33 8 0 17 8 2 8 1 17 8 0 184 8 2 8 1 184 8 0 35 8 2 8 1 35 8 0 68 8 2 8 1 68 8 0 122 8 2 8 1 122 8 0 191 8 2 8 1 191 8 0 41 8 2 8 1 41 8 0 66 8 2 8 1 66 8 0 158 8 2 8 1 158 8 0 37 ...
result:
ok
Test #8:
score: 10
Accepted
time: 1ms
memory: 9984kb
input:
200 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
8 0 63 8 2 8 0 55 8 2 8 0 86 8 2 8 0 96 8 2 8 0 108 8 2 8 0 117 8 2 8 0 33 8 2 8 0 17 8 2 8 0 184 8 2 8 0 35 8 2 8 0 68 8 2 8 0 122 8 2 8 0 191 8 2 8 0 41 8 2 8 0 66 8 2 8 0 158 8 2 8 0 37 8 2 8 0 104 8 2 8 0 162 8 2 8 0 15 8 2 8 0 163 8 2 8 0 25 8 2 8 0 153 8 2 8 0 23 8 2 8 0 116 8 2 8 0 114 8 2 8 ...
result:
ok
Test #9:
score: 10
Accepted
time: 3ms
memory: 9984kb
input:
200 1 1 1 1 2 1 1 2 1 2 2 1 2 2 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
output:
8 0 63 8 2 8 0 55 8 2 8 0 86 8 2 8 0 96 8 2 8 0 108 8 2 8 1 108 8 0 117 8 2 8 0 33 8 2 8 0 17 8 2 8 1 17 8 0 184 8 2 8 0 35 8 2 8 1 35 8 0 68 8 2 8 1 68 8 0 122 8 2 8 0 191 8 2 8 1 191 8 0 41 8 2 8 1 41 8 0 66 8 2 8 0 158 8 2 8 0 37 8 2 8 0 104 8 2 8 0 162 8 2 8 1 162 8 0 15 8 2 8 1 15 8 0 163 8 2 8...
result:
ok
Test #10:
score: 10
Accepted
time: 0ms
memory: 10268kb
input:
198 1 1 1 2 1 1 1 1 2 1 2 2 2 1 1 2 2 2 2 1 2 1 2 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
output:
8 0 63 8 2 8 0 55 8 2 8 0 86 8 2 8 0 96 8 2 8 1 96 8 0 108 8 2 8 0 117 8 2 8 0 33 8 2 8 0 17 8 2 8 0 184 8 2 8 1 184 8 0 35 8 2 8 0 68 8 2 8 1 68 8 0 122 8 2 8 1 122 8 0 191 8 2 8 1 191 8 0 41 8 2 8 0 66 8 2 8 0 158 8 2 8 1 158 8 0 37 8 2 8 1 37 8 0 104 8 2 8 1 104 8 0 162 8 2 8 1 162 8 0 15 8 2 8 0...
result:
ok
Test #11:
score: 10
Accepted
time: 0ms
memory: 9984kb
input:
199 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
output:
8 0 63 8 2 8 0 55 8 2 8 1 55 8 0 86 8 2 8 1 86 8 0 96 8 2 8 1 96 8 0 108 8 2 8 1 108 8 0 117 8 2 8 1 117 8 0 33 8 2 8 1 33 8 0 17 8 2 8 1 17 8 0 184 8 2 8 1 184 8 0 35 8 2 8 1 35 8 0 68 8 2 8 1 68 8 0 122 8 2 8 1 122 8 0 191 8 2 8 1 191 8 0 41 8 2 8 1 41 8 0 66 8 2 8 1 66 8 0 158 8 2 8 1 158 8 0 37 ...
result:
ok
Test #12:
score: 10
Accepted
time: 3ms
memory: 10012kb
input:
197 1 1 1 1 1 1 1 2 2 1 2 2 2 2 1 2 2 1 1 2 2 1 1 1 1 2 2 1 1 2 2 2 1 1 1 2 2 1 1 2 2 2 1 1 1 1 2 2 1 2 1 2 2 2 2 2 1 1 1 2 1 2 2 2 2 2 1 1 1 1 2 2 2 1 2 1 2 1 2 1 1 2 1 1 1 2 2 2 1 2 2 1 2 1 1 1 2 1 1 1 1 1 2 2 2 1 2 1 2 1 1 1 1 2 1 2 2 2 2 1 2 2 2 1 1 1 2 1 2 1 1 1 1 2 2 1 1 1 1 2 2 1 2 2 2 1 1 1 ...
output:
8 0 63 8 2 8 0 55 8 2 8 0 86 8 2 8 0 96 8 2 8 0 108 8 2 8 0 117 8 2 8 0 33 8 2 8 0 17 8 2 8 1 17 8 0 184 8 2 8 1 184 8 0 35 8 2 8 0 68 8 2 8 1 68 8 0 122 8 2 8 1 122 8 0 191 8 2 8 1 191 8 0 41 8 2 8 1 41 8 0 66 8 2 8 0 158 8 2 8 1 158 8 0 37 8 2 8 1 37 8 0 104 8 2 8 0 162 8 2 8 0 15 8 2 8 1 15 8 0 1...
result:
ok
Test #13:
score: 0
Wrong Answer
time: 5ms
memory: 7936kb
input:
197 1 2 1 2 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
output:
8 0 63 8 2 8 0 55 8 2 8 1 55 8 0 86 8 2 8 0 96 8 2 8 1 96 8 0 108 8 2 8 1 108 8 0 117 8 2 8 0 33 8 2 8 1 33 8 0 17 8 2 8 1 17 8 0 184 8 2 8 1 184 8 0 35 8 2 8 0 68 8 2 8 1 68 8 0 122 8 2 8 1 122 8 0 191 8 2 8 1 191 8 0 41 8 2 8 1 41 8 0 66 8 2 8 1 66 8 0 158 8 2 8 1 158 8 0 37 8 2 8 1 37 8 0 104 8 2...
result:
wrong answer Wrong answer.
Subtask #2:
score: 0
Wrong Answer
Test #24:
score: 15
Accepted
time: 0ms
memory: 8232kb
input:
1000 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...
output:
8 0 374 8 2 8 0 882 8 2 8 1 882 8 0 408 8 2 8 1 408 8 0 846 8 2 8 1 846 8 0 968 8 2 8 1 968 8 0 369 8 2 8 1 369 8 0 33 8 2 8 1 33 8 0 528 8 2 8 1 528 8 0 757 8 2 8 1 757 8 0 989 8 2 8 1 989 8 0 359 8 2 8 1 359 8 0 122 8 2 8 1 122 8 0 928 8 2 8 1 928 8 0 41 8 2 8 1 41 8 0 737 8 2 8 1 737 8 0 647 8 2 ...
result:
ok
Test #25:
score: 15
Accepted
time: 2ms
memory: 10084kb
input:
1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
8 0 374 8 2 8 0 882 8 2 8 0 408 8 2 8 0 846 8 2 8 0 968 8 2 8 0 369 8 2 8 0 33 8 2 8 0 528 8 2 8 0 757 8 2 8 0 989 8 2 8 0 359 8 2 8 0 122 8 2 8 0 928 8 2 8 0 41 8 2 8 0 737 8 2 8 0 647 8 2 8 0 37 8 2 8 0 510 8 2 8 0 482 8 2 8 0 15 8 2 8 0 935 8 2 8 0 994 8 2 8 0 966 8 2 8 0 834 8 2 8 0 116 8 2 8 0 ...
result:
ok
Test #26:
score: 15
Accepted
time: 11ms
memory: 10008kb
input:
999 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 2 1 1 2 1 2 2 2 2 2 1 2 2 2 1 1 2 1 2 2 2 2 1 2 2 2 1 2 1 1 2 2 2 2 2 2 1 1 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
output:
8 0 379 8 2 8 0 968 8 2 8 0 122 8 2 8 0 469 8 2 8 0 967 8 2 8 0 517 8 2 8 0 41 8 2 8 0 486 8 2 8 0 278 8 2 8 0 719 8 2 8 1 719 8 0 941 8 2 8 0 816 8 2 8 1 816 8 0 558 8 2 8 0 633 8 2 8 1 633 8 0 105 8 2 8 0 375 8 2 8 1 375 8 0 184 8 2 8 0 53 8 2 8 0 802 8 2 8 1 802 8 0 893 8 2 8 0 165 8 2 8 1 165 8 ...
result:
ok
Test #27:
score: 15
Accepted
time: 12ms
memory: 10020kb
input:
999 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 2 1 1 2 1 1 1 2 1 2 2 2 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
output:
8 0 379 8 2 8 0 968 8 2 8 1 968 8 0 122 8 2 8 0 469 8 2 8 0 967 8 2 8 0 517 8 2 8 0 41 8 2 8 0 486 8 2 8 0 278 8 2 8 0 719 8 2 8 0 941 8 2 8 0 816 8 2 8 1 816 8 0 558 8 2 8 0 633 8 2 8 0 105 8 2 8 0 375 8 2 8 0 184 8 2 8 1 184 8 0 53 8 2 8 1 53 8 0 802 8 2 8 0 893 8 2 8 0 165 8 2 8 1 165 8 0 15 8 2 ...
result:
ok
Test #28:
score: 15
Accepted
time: 14ms
memory: 7952kb
input:
996 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
output:
8 0 379 8 2 8 0 968 8 2 8 1 968 8 0 122 8 2 8 1 122 8 0 469 8 2 8 1 469 8 0 967 8 2 8 1 967 8 0 517 8 2 8 1 517 8 0 41 8 2 8 1 41 8 0 486 8 2 8 1 486 8 0 278 8 2 8 1 278 8 0 719 8 2 8 1 719 8 0 941 8 2 8 1 941 8 0 816 8 2 8 1 816 8 0 558 8 2 8 1 558 8 0 633 8 2 8 1 633 8 0 105 8 2 8 1 105 8 0 375 8 ...
result:
ok
Test #29:
score: 15
Accepted
time: 0ms
memory: 9992kb
input:
995 1 1 1 2 1 2 2 1 2 2 1 2 2 2 1 2 2 2 2 1 1 2 2 1 1 2 2 1 2 1 2 1 2 1 1 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1 1 1 2 2 2 2 1 2 1 2 1 1 2 1 2 2 2 2 1 2 1 2 1 1 2 1 2 2 2 1 2 2 1 1 2 1 2 1 1 1 2 1 2 1 1 1 1 1 2 1 2 2 2 2 1 2 2 1 2 2 2 2 1 2 2 1 2 1 1 2 1 1 2 2 1 1 1 2 2 1 1 1 1 2 1 2 2 1 2 2 1 1 1 2 1 1 2 ...
output:
8 0 379 8 2 8 0 968 8 2 8 0 122 8 2 8 0 469 8 2 8 1 469 8 0 967 8 2 8 0 517 8 2 8 1 517 8 0 41 8 2 8 1 41 8 0 486 8 2 8 0 278 8 2 8 1 278 8 0 719 8 2 8 1 719 8 0 941 8 2 8 0 816 8 2 8 1 816 8 0 558 8 2 8 1 558 8 0 633 8 2 8 1 633 8 0 105 8 2 8 0 375 8 2 8 1 375 8 0 184 8 2 8 1 184 8 0 53 8 2 8 1 53 ...
result:
ok
Test #30:
score: 0
Wrong Answer
time: 7ms
memory: 9980kb
input:
998 1 2 1 1 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
output:
8 0 379 8 2 8 0 968 8 2 8 1 968 8 0 122 8 2 8 0 469 8 2 8 0 967 8 2 8 1 967 8 0 517 8 2 8 1 517 8 0 41 8 2 8 1 41 8 0 486 8 2 8 0 278 8 2 8 1 278 8 0 719 8 2 8 1 719 8 0 941 8 2 8 1 941 8 0 816 8 2 8 1 816 8 0 558 8 2 8 1 558 8 0 633 8 2 8 1 633 8 0 105 8 2 8 1 105 8 0 375 8 2 8 1 375 8 0 184 8 2 8 ...
result:
wrong answer Wrong answer.
Subtask #3:
score: 0
Wrong Answer
Test #43:
score: 75
Accepted
time: 0ms
memory: 10068kb
input:
2 1 2
output:
8 0 0 8 2 8 0 1 8 2 8 1 1 8 3 2
result:
ok
Test #44:
score: 75
Accepted
time: 0ms
memory: 9984kb
input:
2 1 1 1
output:
8 0 0 8 2 8 0 1 8 2 8 1 1 8 1 0 8 0 1 8 0 0 8 2 8 1 0 8 1 1 8 3 1
result:
ok
Test #45:
score: 75
Accepted
time: 2ms
memory: 10012kb
input:
3 1 1 2 1 1
output:
8 0 0 8 2 8 0 1 8 2 8 0 2 8 2 8 1 2 8 1 1 8 1 0 8 0 0 8 0 1 8 2 8 1 1 8 0 2 8 2 8 1 2 8 1 0 8 3 1
result:
ok
Test #46:
score: 75
Accepted
time: 0ms
memory: 9972kb
input:
6 1 2 1 2 2 2 1 1 1 1 1
output:
8 0 3 8 2 8 0 1 8 2 8 1 1 8 0 2 8 2 8 0 0 8 2 8 1 0 8 0 4 8 2 8 1 4 8 0 5 8 2 8 1 5 8 1 2 8 1 3 8 0 2 8 0 3 8 2 8 1 3 8 0 1 8 2 8 1 1 8 0 0 8 2 8 1 0 8 0 4 8 2 8 1 4 8 0 5 8 2 8 1 5 8 1 2 8 3 1
result:
ok
Test #47:
score: 75
Accepted
time: 0ms
memory: 10244kb
input:
10 1 2 2 1 2 2 2 2 2 2 1 1 1 2 3 4 5 6 6
output:
8 0 3 8 2 8 0 7 8 2 8 1 7 8 0 2 8 2 8 1 2 8 0 8 8 2 8 0 6 8 2 8 1 6 8 0 5 8 2 8 1 5 8 0 4 8 2 8 1 4 8 0 9 8 2 8 1 9 8 0 0 8 2 8 1 0 8 0 1 8 2 8 1 1 8 1 8 8 1 3 8 0 0 8 0 3 8 2 8 1 3 8 0 7 8 2 8 1 7 8 0 2 8 2 8 1 2 8 0 8 8 2 8 0 6 8 2 8 0 5 8 2 8 0 4 8 2 8 0 9 8 2 8 0 1 8 2 8 1 1 8 1 9 8 1 4 8 1 5 8 ...
result:
ok
Test #48:
score: 75
Accepted
time: 14ms
memory: 10020kb
input:
2000 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...
output:
8 0 1892 8 2 8 0 1703 8 2 8 1 1703 8 0 122 8 2 8 1 122 8 0 1692 8 2 8 1 1692 8 0 1088 8 2 8 1 1088 8 0 517 8 2 8 1 517 8 0 41 8 2 8 1 41 8 0 1235 8 2 8 1 1235 8 0 1262 8 2 8 1 1262 8 0 719 8 2 8 1 719 8 0 1248 8 2 8 1 1248 8 0 816 8 2 8 1 816 8 0 1799 8 2 8 1 1799 8 0 633 8 2 8 1 633 8 0 105 8 2 8 1...
result:
ok
Test #49:
score: 75
Accepted
time: 13ms
memory: 8252kb
input:
2000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
8 0 1892 8 2 8 0 1703 8 2 8 0 122 8 2 8 0 1692 8 2 8 0 1088 8 2 8 0 517 8 2 8 0 41 8 2 8 0 1235 8 2 8 0 1262 8 2 8 0 719 8 2 8 0 1248 8 2 8 0 816 8 2 8 0 1799 8 2 8 0 633 8 2 8 0 105 8 2 8 0 1445 8 2 8 0 1056 8 2 8 0 53 8 2 8 0 802 8 2 8 0 893 8 2 8 0 165 8 2 8 0 1369 8 2 8 0 459 8 2 8 0 275 8 2 8 0...
result:
ok
Test #50:
score: 70.58
Acceptable Answer
time: 23ms
memory: 10032kb
input:
2000 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 2 1 2 1 2 1 1 2 1 2 1 1 2 1 1 2 2 2 2 1 2 1 2 2 2 1 1 1 2 2 1 2 1 1 2 2 2 1 1 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 1 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1...
output:
8 0 1892 8 2 8 0 1703 8 2 8 0 122 8 2 8 0 1692 8 2 8 0 1088 8 2 8 0 517 8 2 8 0 41 8 2 8 0 1235 8 2 8 0 1262 8 2 8 0 719 8 2 8 1 719 8 0 1248 8 2 8 0 816 8 2 8 0 1799 8 2 8 0 633 8 2 8 0 105 8 2 8 1 105 8 0 1445 8 2 8 0 1056 8 2 8 1 1056 8 0 53 8 2 8 0 802 8 2 8 1 802 8 0 893 8 2 8 0 165 8 2 8 1 165...
result:
points 0.94106666670 points 0.94106666670
Test #51:
score: 62.03
Acceptable Answer
time: 5ms
memory: 9944kb
input:
2000 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 2 1 1 1 2 1 1 1 1 2 1 1 2 2 2 2 1 2 1 2 1 2 1 1 1 2 2 2 1 1 2 2 2 2 1 2 1 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...
output:
8 0 1438 8 2 8 0 48 8 2 8 0 1177 8 2 8 0 456 8 2 8 0 1645 8 2 8 0 1731 8 2 8 0 22 8 2 8 0 445 8 2 8 0 238 8 2 8 0 1457 8 2 8 0 616 8 2 8 0 162 8 2 8 0 1251 8 2 8 0 1520 8 2 8 1 1520 8 0 368 8 2 8 0 1881 8 2 8 1 1881 8 0 530 8 2 8 1 530 8 0 797 8 2 8 0 70 8 2 8 0 1361 8 2 8 0 223 8 2 8 1 223 8 0 1103...
result:
points 0.82706666670 points 0.82706666670
Test #52:
score: 75
Accepted
time: 8ms
memory: 8248kb
input:
2000 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...
output:
8 0 1438 8 2 8 0 48 8 2 8 1 48 8 0 1177 8 2 8 1 1177 8 0 456 8 2 8 1 456 8 0 1645 8 2 8 1 1645 8 0 1731 8 2 8 1 1731 8 0 22 8 2 8 1 22 8 0 445 8 2 8 1 445 8 0 238 8 2 8 1 238 8 0 1457 8 2 8 1 1457 8 0 616 8 2 8 1 616 8 0 162 8 2 8 1 162 8 0 1251 8 2 8 1 1251 8 0 1520 8 2 8 1 1520 8 0 368 8 2 8 1 368...
result:
ok
Test #53:
score: 75
Accepted
time: 0ms
memory: 10000kb
input:
2000 1 2 2 2 2 2 2 1 2 1 1 2 2 2 2 2 1 1 1 2 1 1 1 2 1 1 2 1 1 2 1 2 2 1 1 1 2 2 2 1 2 1 1 2 2 1 2 1 1 2 2 2 1 1 1 2 2 1 2 1 2 2 2 2 1 1 1 2 2 1 2 2 1 2 2 2 2 2 2 1 1 1 1 1 1 1 1 2 2 1 1 2 2 1 2 2 1 1 1 2 2 1 1 2 1 1 2 1 2 1 2 2 2 1 1 2 1 1 1 2 2 1 2 2 1 1 2 2 2 2 1 1 2 1 2 2 2 1 1 1 2 1 2 1 2 2 1 1...
output:
8 0 1438 8 2 8 0 48 8 2 8 1 48 8 0 1177 8 2 8 1 1177 8 0 456 8 2 8 1 456 8 0 1645 8 2 8 1 1645 8 0 1731 8 2 8 1 1731 8 0 22 8 2 8 1 22 8 0 445 8 2 8 0 238 8 2 8 1 238 8 0 1457 8 2 8 0 616 8 2 8 0 162 8 2 8 1 162 8 0 1251 8 2 8 1 1251 8 0 1520 8 2 8 1 1520 8 0 368 8 2 8 1 368 8 0 1881 8 2 8 1 1881 8 ...
result:
ok
Test #54:
score: 0
Wrong Answer
time: 8ms
memory: 10292kb
input:
2000 1 1 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...
output:
8 0 1438 8 2 8 0 48 8 2 8 0 1177 8 2 8 0 456 8 2 8 1 456 8 0 1645 8 2 8 1 1645 8 0 1731 8 2 8 1 1731 8 0 22 8 2 8 1 22 8 0 445 8 2 8 1 445 8 0 238 8 2 8 1 238 8 0 1457 8 2 8 1 1457 8 0 616 8 2 8 0 162 8 2 8 1 162 8 0 1251 8 2 8 1 1251 8 0 1520 8 2 8 1 1520 8 0 368 8 2 8 1 368 8 0 1881 8 2 8 1 1881 8...
result:
wrong answer Wrong answer.