QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#432517 | #8777. Passport Stamps | ucup-team3772# | AC ✓ | 6ms | 4712kb | C++14 | 13.9kb | 2024-06-07 09:41:36 | 2024-06-07 09:41:36 |
Judging History
answer
/*
author: honglan0301
Sexy_goodier _ xiaoqing
*/
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cctype>
#include <queue>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <cmath>
#include <random>
#include <set>
#include <bitset>
#include <assert.h>
using namespace std;
//namespace Fread{const int SIZE=1<<20;char buf[SIZE],*S,*T;inline char getchar(){if(S==T){T=(S=buf)+fread(buf,1,SIZE,stdin);if(S==T)return'\n';}return*S++;}}using namespace Fread;namespace Fwrite{const int SIZE=1<<20;char buf[SIZE],*S=buf,*T=buf+SIZE;inline void flush(){fwrite(buf,1,S-buf,stdout);S=buf;}inline void putchar(char c){*S++=c;if(S==T)flush();}struct NTR{~NTR(){flush();}}ztr;}using namespace Fwrite;
//#define getchar Fread::getchar
//#define putchar Fwrite::putchar
namespace Fastio{struct Reader{template<typename T>Reader&operator>>(T&x){x=0;short f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f*=-1;c=getchar();}while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+(c^48),c=getchar();x*=f;return*this;}Reader&operator>>(double&x){x=0;double t=0;short f=1,s=0;char c=getchar();while((c<'0'||c>'9')&&c!='.'){if(c=='-')f*=-1;c=getchar();}while(c>='0'&&c<='9'&&c!='.')x=x*10+(c^48),c=getchar();if(c=='.')c=getchar();else{x*=f;return*this;}while(c>='0'&&c<='9')t=t*10+(c^48),s++,c=getchar();while(s--)t/=10.0;x=(x+t)*f;return*this;}Reader&operator>>(long double&x){x=0;long double t=0;short f=1,s=0;char c=getchar();while((c<'0'||c>'9')&&c!='.'){if(c=='-')f*=-1;c=getchar();}while(c>='0'&&c<='9'&&c!='.')x=x*10+(c^48),c=getchar();if(c=='.')c=getchar();else{x*=f;return*this;}while(c>='0'&&c<='9')t=t*10+(c^48),s++,c=getchar();while(s--)t/=10.0;x=(x+t)*f;return*this;}Reader&operator>>(__float128&x){x=0;__float128 t=0;short f=1,s=0;char c=getchar();while((c<'0'||c>'9')&&c!='.'){if(c=='-')f*=-1;c=getchar();}while(c>='0'&&c<='9'&&c!='.')x=x*10+(c^48),c=getchar();if(c=='.')c=getchar();else{x*=f;return*this;}while(c>='0'&&c<='9')t=t*10+(c^48),s++,c=getchar();while(s--)t/=10.0;x=(x+t)*f;return*this;}Reader&operator>>(char&c){c=getchar();while(c==' '||c=='\n'||c=='\r')c=getchar();return*this;}Reader&operator>>(char*str){int len=0;char c=getchar();while(c==' '||c=='\n'||c=='\r')c=getchar();while(c!=' '&&c!='\n'&&c!='\r')str[len++]=c,c=getchar();str[len]='\0';return*this;}Reader&operator>>(string&str){str.clear();char c=getchar();while(c==' '||c=='\n'||c=='\r')c=getchar();while(c!=' '&&c!='\n'&&c!='\r')str.push_back(c),c=getchar();return*this;}Reader(){}}cin;const char endl='\n';struct Writer{const int Setprecision=6;typedef int mxdouble;template<typename T>Writer&operator<<(T x){if(x==0){putchar('0');return*this;}if(x<0)putchar('-'),x=-x;static short sta[40];short top=0;while(x>0)sta[++top]=x%10,x/=10;while(top>0)putchar(sta[top]+'0'),top--;return*this;}Writer&operator<<(double x){if(x<0)putchar('-'),x=-x;mxdouble _=x;x-=(double)_;static short sta[40];short top=0;while(_>0)sta[++top]=_%10,_/=10;if(top==0)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;putchar('.');for(int i=0;i<Setprecision;i++)x*=10;_=x;while(_>0)sta[++top]=_%10,_/=10;for(int i=0;i<Setprecision-top;i++)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;return*this;}Writer&operator<<(long double x){if(x<0)putchar('-'),x=-x;mxdouble _=x;x-=(long double)_;static short sta[40];short top=0;while(_>0)sta[++top]=_%10,_/=10;if(top==0)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;putchar('.');for(int i=0;i<Setprecision;i++)x*=10;_=x;while(_>0)sta[++top]=_%10,_/=10;for(int i=0;i<Setprecision-top;i++)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;return*this;}Writer&operator<<(__float128 x){if(x<0)putchar('-'),x=-x;mxdouble _=x;x-=(__float128)_;static short sta[40];short top=0;while(_>0)sta[++top]=_%10,_/=10;if(top==0)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;putchar('.');for(int i=0;i<Setprecision;i++)x*=10;_=x;while(_>0)sta[++top]=_%10,_/=10;for(int i=0;i<Setprecision-top;i++)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;return*this;}Writer&operator<<(char c){putchar(c);return*this;}Writer&operator<<(char*str){int cur=0;while(str[cur])putchar(str[cur++]);return*this;}Writer&operator<<(const char*str){int cur=0;while(str[cur])putchar(str[cur++]);return*this;}Writer&operator<<(string str){int st=0,ed=str.size();while(st<ed)putchar(str[st++]);return*this;}Writer(){}}cout;}using namespace Fastio;
#define cin Fastio::cin
#define cout Fastio::cout
#define endl Fastio::endl//;fflush(stdout)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define int long long
#define ll long long
#define ull unsigned long long
#define mod 998244353
#define G 3
#define Gi 332748118
mt19937 rnd(time(0));
mt19937_64 rndl(time(0));
int ksm(int x,int k) {int na=1; for(int i=1;i<=k;i<<=1) {if(i&k) na=na*x%mod; x=x*x%mod;} return na;}
int gcd(int x,int y) {return !y?x:gcd(y,x%y);}
void exgcd(int u,int v,ll &x,ll &y) {if(!v) return x=1,y=0,void(); exgcd(v,u%v,y,x); y-=u/v*x;}
void CRTmerge(ll la,ll lb,ll&na,ll&nb){ll g=gcd(la,na),x,y;exgcd(la,na,x,y);ll dd=(nb-lb)/g;x*=dd;na=la*na/g;nb=((x*la+lb)%na+na)%na;}
struct MF
{
#define N 1
#define NN 1
#define M 1
struct edge{int son,val,next;}edge[M];
int cnt=1,head[N],nowb[N],dis[N],ff[NN],pre[NN],s,t;
void adde(int x,int y,int z)
{
edge[++cnt]={y,z,head[x]}; head[x]=cnt;
edge[++cnt]={x,0,head[y]}; head[y]=cnt;
}
void clear(int n)
{
for(int i=0;i<=cnt;i++) edge[i]={0,0,0};
for(int i=0;i<=n;i++) head[i]=nowb[i]=dis[i]=0; cnt=1;
}
queue<int>Q;bool bfs(){memset(dis,127,sizeof(dis));dis[s]=0;Q.push(s);while(!Q.empty()){int nr=Q.front();Q.pop();for(int i=head[nr];i>0;i=edge[i].next){if(edge[i].val&&dis[nr]+1<dis[edge[i].son])dis[edge[i].son]=dis[nr]+1,Q.push(edge[i].son);}}return dis[t]<1000000000;}
int bfs2(){memset(ff,0,sizeof(ff));ff[s]=1000000000;pre[s]=-1;Q.push(s);while(!Q.empty()){int nr=Q.front();Q.pop();for(int i=head[nr];i>0;i=edge[i].next){if(!ff[edge[i].son]&&edge[i].val){ff[edge[i].son]=min(edge[i].val,ff[nr]);pre[edge[i].son]=i;Q.push(edge[i].son);}}if(ff[t])break;}while(!Q.empty())Q.pop();return ff[t];}int EK(){int na=0;while(bfs2()){na+=ff[t];for(int j=pre[t];j>0;j=pre[edge[j^1].son])edge[j].val-=ff[t],edge[j^1].val+=ff[t];}return na;}
int dfs(int x,int nfl){if(x==t)return nfl;int nuse=0;for(int i=nowb[x];i>0;i=edge[i].next){nowb[x]=i;if(edge[i].val&&dis[x]+1==dis[edge[i].son]){int flw=dfs(edge[i].son,min(edge[i].val,nfl-nuse));edge[i].val-=flw;edge[i^1].val+=flw;nuse+=flw;if(nuse==nfl)break;}}return nuse;}
int dinic(){int maxflow=0;while(bfs()){memcpy(nowb,head,sizeof(head));maxflow+=dfs(s,1000000000);}return maxflow;}
#undef N
#undef NN
#undef M
}MF;
struct MCMF
{
#define N 1
#define M 1
struct edge
{
int son,val,fey,next;
}edge[M];
int head[N],cnt=1,nowb[N],dis[N],dep[N],maxflow,mincost,s,t;
void adde(int x,int y,int z,int w)
{
edge[++cnt]={y,z,w,head[x]}; head[x]=cnt;
edge[++cnt]={x,0,-w,head[y]}; head[y]=cnt;
}
void clear(int n)
{
for(int i=0;i<=cnt;i++) edge[i]={0,0,0};
for(int i=0;i<=n;i++) head[i]=nowb[i]=dis[i]=dep[i]=0; cnt=1;
}
queue<int>Q;bool spfa(){memset(dis,127,sizeof(dis));dis[s]=dep[s]=0;Q.push(s);while(!Q.empty()){int nr=Q.front();Q.pop();for(int i=head[nr];i>0;i=edge[i].next){if(edge[i].val&&dis[nr]+edge[i].fey<dis[edge[i].son]){dis[edge[i].son]=dis[nr]+edge[i].fey;dep[edge[i].son]=dep[nr]+1;Q.push(edge[i].son);}}}return dis[t]<1000000000000;}int dfs(int x,int nfl){if(x==t)return mincost+=nfl*dis[t],nfl;int nuse=0;for(int i=nowb[x];i>0;i=edge[i].next){nowb[x]=i;if(edge[i].val&&dis[x]+edge[i].fey==dis[edge[i].son]&&dep[x]+1==dep[edge[i].son]){int flw=dfs(edge[i].son,min(edge[i].val,nfl-nuse));edge[i].val-=flw;edge[i^1].val+=flw;nuse+=flw;if(nuse==nfl)break;}}return nuse;}
pair<int,int>dinic(){maxflow=mincost=0;while(spfa()){memcpy(nowb,head,sizeof(nowb));maxflow+=dfs(s,1000000000);}return mp(maxflow,mincost);}
#undef N
#undef M
}MCMF;
struct SA
{
#define N 1
#define M 135
int s[N],rk[N],sa[N],lrk[N],buc[N],id[N],ht[N];
void clear(int n) {memset(buc,0,sizeof(buc[0])*(n+3));}
void build(int n){int m=M,p=0;for(int i=1;i<=n;i++)buc[rk[i]=s[i]]++;for(int i=1;i<=M;i++)buc[i]+=buc[i-1];for(int i=1;i<=n;i++)sa[buc[rk[i]]--]=i;for(int w=1;w<=n;w<<=1){for(int i=n-w+1;i<=n;i++)id[++p]=i;for(int i=1;i<=n;i++)if(sa[i]>w)id[++p]=sa[i]-w;memcpy(lrk,rk,sizeof(rk[0])*(n+3));memset(buc,0,sizeof(buc[0])*(m+3));p=0;for(int i=1;i<=n;i++)buc[lrk[i]]++;for(int i=1;i<=m;i++)buc[i]+=buc[i-1];for(int i=n;i>=1;i--)sa[buc[lrk[id[i]]]--]=id[i];for(int i=1;i<=n;i++)rk[sa[i]]=(lrk[sa[i]]==lrk[sa[i-1]]&&lrk[sa[i]+w]==lrk[sa[i-1]+w])?p:++p;m=p;p=0;if(m==n)break;}for(int i=1,k=0;i<=n;i++){k--;if(k<0)k++;while(s[i+k]==s[sa[rk[i]-1]+k])k++;ht[rk[i]]=k;}}
#undef N
#undef M
}SA;
struct LC
{
#define N 1
int n,x[N],y[N],F[N],lf[N],nf[N];
void init(){lf[0]=1;for(int i=1;i<=n;i++){for(int j=n;j>=0;j--)lf[j]=(lf[j]*(mod-x[i])+((j>0)?lf[j-1]:0))%mod;}for(int i=1;i<=n;i++){int prd=1;for(int j=1;j<=n;j++)if(i!=j)prd=prd*(x[i]-x[j]+mod)%mod;prd=ksm(prd,mod-2);for(int j=n;j>=0;j--)nf[j]=(lf[j+1]+x[i]*nf[j+1])%mod;for(int j=0;j<=n;j++)F[j]=(F[j]+y[i]*nf[j]%mod*prd)%mod;}}
int solve(int k){int na=0;for(int i=n;i>=0;i--)na=(na*k+F[i])%mod;return na;}
#undef N
}LC;
struct LO
{
struct node
{
int cntu,cntr,sums;
friend node operator+(node x,node y)
{
node z;
z.cntu=(x.cntu+y.cntu)%mod; z.cntr=(x.cntr+y.cntr)%mod;
z.sums=(x.sums+y.sums+x.cntu*y.cntr)%mod; return z;
}
};
node getk() {node x; x.cntu=x.cntr=x.sums=0; return x;}
node getr() {node x; x.cntu=x.sums=0; x.cntr=1; return x;}
node getu() {node x; x.cntu=1; x.cntr=x.sums=0; return x;}
node ksm(node x,int k){node na=getk();for(int i=1;i<=k;i<<=1){if(i&k)na=na+x;x=x+x;}return na;}node solve(int p,int r,int q,int x,node nu,node nr){if(!x)return getk();if(p*x+r<q)return ksm(nr,x);if(p>=q||r>=q)return ksm(nu,r/q)+solve(p%q,r%q,q,x,nu,ksm(nu,p/q)+nr);int m=(p*x+r)/q;return ksm(nr,(q-r-1)/p)+nu+solve(q,(q-r-1)%p,p,m-1,nr,nu)+ksm(nr,x-(q*m-r-1)/p);}
}LO;
struct NTT
{
#define N 1
int rv[N],lim,L;
void init(int n) {lim=1,L=0; while(lim<=n) lim<<=1,L++; for(int i=0;i<lim;i++) rv[i]=(rv[i>>1]>>1)|((i&1)<<L-1);}
void work(int x[],int flag){for(int i=0;i<lim;i++)if(i<rv[i])swap(x[i],x[rv[i]]);for(int len=1;len<lim;len<<=1){int w=ksm((flag==1)?G:Gi,(mod-1)/(len<<1));for(int j=0;j<lim;j+=(len<<1)){int nw=1;for(int k=0;k<len;k++){int xx=x[j|k],yy=nw*x[j|k|len]%mod;x[j|k]=(xx+yy)%mod;x[j|k|len]=(xx-yy+mod)%mod;nw=nw*w%mod;}}}if(flag==-1){int iv=ksm(lim,mod-2);for(int i=0;i<lim;i++)x[i]=x[i]*iv%mod;}}
#undef N
}NTT;
struct FWT
{
void AND(int x[],int n,int flag){for(int len=1;len<(1<<n);len<<=1){for(int j=0;j<(1<<n);j+=(len<<1)){for(int k=0;k<len;k++){if(flag==1)x[j|k]=(x[j|k]+x[j|k|len])%mod;else x[j|k]=(x[j|k]-x[j|k|len]+mod)%mod;}}}}
void OR(int x[],int n,int flag){for(int len=1;len<(1<<n);len<<=1){for(int j=0;j<(1<<n);j+=(len<<1)){for(int k=0;k<len;k++){if(flag==1)x[j|k|len]=(x[j|k|len]+x[j|k])%mod;else x[j|k|len]=(x[j|k|len]-x[j|k]+mod)%mod;}}}}
void XOR(int x[],int n,int flag){for(int len=1;len<(1<<n);len<<=1){for(int j=0;j<(1<<n);j+=(len<<1)){for(int k=0;k<len;k++){int xx=x[j|k],yy=x[j|k|len];x[j|k]=(xx+yy)%mod;x[j|k|len]=(xx-yy+mod)%mod;}}}if(flag==-1){int iv=ksm((1<<n),mod-2);for(int i=0;i<(1<<n);i++)x[i]=x[i]*iv%mod;}}
}FWT;
/*struct PT
{
int x,y;
bool operator<(const PT &rs) {return x!=rs.x?x<rs.x:y<rs.y;}
bool operator>(const PT &rs) {return x!=rs.x?x>rs.x:y>rs.y;}
bool operator==(const PT &rs) {return x==rs.x&&y==rs.y;}
PT operator+(const PT &rs) {return {x+rs.x,y+rs.y};}
PT operator-(const PT &rs) {return {x-rs.x,y-rs.y};}
}nl,stk[1];
int arg(PT xx) {return (int)xx.x*xx.x+(int)xx.y*xx.y;}
int cross(PT xx,PT yy) {return (int)xx.x*yy.y-(int)xx.y*yy.x;}
int dot(PT xx,PT yy) {return (int)xx.x*yy.x+(int)xx.y*yy.y;}*/
struct PT
{
double x,y;
bool operator<(const PT &rs) {return x!=rs.x?x<rs.x:y<rs.y;}
bool operator>(const PT &rs) {return x!=rs.x?x>rs.x:y>rs.y;}
bool operator==(const PT &rs) {return x==rs.x&&y==rs.y;}
PT operator+(const PT &rs) {return {x+rs.x,y+rs.y};}
PT operator-(const PT &rs) {return {x-rs.x,y-rs.y};}
PT operator*(const double rs) {return {x*rs,y*rs};}
PT operator/(const double rs) {return {x/rs,y/rs};}
}nl,STK[1];
double arg(PT xx) {return xx.x*xx.x+xx.y*xx.y;}
double len(PT xx) {return sqrt(arg(xx));}
double cross(PT xx,PT yy) {return xx.x*yy.y-xx.y*yy.x;}
double dot(PT xx,PT yy) {return xx.x*yy.x+xx.y*yy.y;}
double cdis(PT xx,PT yy) {return sqrt(arg(xx-yy));}
PT rotate(PT xx,double rad) {return {xx.x*cos(rad)+xx.y*sin(rad),-xx.x*sin(rad)+xx.y*cos(rad)};}
bool cmpPT(PT xx,PT yy) {return cross(xx-nl,yy-nl)!=0?cross(xx-nl,yy-nl)<0:arg(xx-nl)<arg(yy-nl);}
void init(vector<PT> &xx)
{
sort(xx.begin(),xx.end());
xx.erase(unique(xx.begin(),xx.end()),xx.end());
int top;
nl=xx[top=0]; sort(xx.begin()+1,xx.end(),cmpPT);
for(auto i:xx)
{
while(top>=2&&cross(i-STK[top],STK[top]-STK[top-1])<=0) top--;
STK[++top]=i;
}
xx.clear(); for(int i=1;i<=top;i++) xx.pb(STK[i]);
}
void init2(vector<PT> &xx)
{
int top; nl=xx[top=0];
for(auto i:xx)
{
while(top>=2&&cross(i-STK[top],STK[top]-STK[top-1])<=0) top--;
STK[++top]=i;
}
xx.clear(); for(int i=1;i<=top;i++) xx.pb(STK[i]);
}
vector<PT> merge(vector<PT> xx,vector<PT> yy)
{
vector<PT> na,nx,ny; na.pb(xx[0]+yy[0]); int L=xx.size(),R=yy.size(),cntl=0,cntr=0;
for(int i=0;i<L;i++) nx.pb(xx[(i+1)%L]-xx[i]); for(int i=0;i<R;i++) ny.pb(yy[(i+1)%R]-yy[i]);
while(cntl<L&&cntr<R) {int cc=cross(nx[cntl],ny[cntr]); na.pb(na.back()+((cc<0||!cc&&nx[cntl]>ny[cntr])?nx[cntl++]:ny[cntr++]));}
while(cntl+1<L) na.pb(na.back()+nx[cntl++]);
while(cntr+1<R) na.pb(na.back()+ny[cntr++]); return na;
}
int n,p,c[100005];
signed main()
{
cin>>n>>p;
for(int i=1;i<=n;i++) cin>>c[i];
//sort(c+1,c+n+1);
int sum=0;
for(int i=1;i<=n;i++)
{
if((p-sum+i-1)/i<=c[i]-1)
{
cout<<i-1<<endl; return 0;
}
sum+=c[i];
}
cout<<n<<endl; return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3932kb
input:
5 15 1 2 3 4 5
output:
3
result:
ok single line: '3'
Test #2:
score: 0
Accepted
time: 2ms
memory: 4508kb
input:
100000 559309580160692839 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
84437
result:
ok single line: '84437'
Test #3:
score: 0
Accepted
time: 1ms
memory: 4712kb
input:
100000 890934113082207108 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
53636
result:
ok single line: '53636'
Test #4:
score: 0
Accepted
time: 1ms
memory: 4648kb
input:
100000 132839930703581978 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
59360
result:
ok single line: '59360'
Test #5:
score: 0
Accepted
time: 1ms
memory: 4564kb
input:
100000 761263352659137865 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
67748
result:
ok single line: '67748'
Test #6:
score: 0
Accepted
time: 1ms
memory: 4600kb
input:
100000 654001515423941861 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
25745
result:
ok single line: '25745'
Test #7:
score: 0
Accepted
time: 1ms
memory: 4304kb
input:
100000 755568812034403272 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
40873
result:
ok single line: '40873'
Test #8:
score: 0
Accepted
time: 2ms
memory: 4452kb
input:
100000 783129347604694200 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
44527
result:
ok single line: '44527'
Test #9:
score: 0
Accepted
time: 1ms
memory: 4304kb
input:
100000 905120603799436149 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
58851
result:
ok single line: '58851'
Test #10:
score: 0
Accepted
time: 1ms
memory: 4712kb
input:
100000 240004036785370527 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
42660
result:
ok single line: '42660'
Test #11:
score: 0
Accepted
time: 1ms
memory: 4304kb
input:
100000 548919634536408821 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
30657
result:
ok single line: '30657'
Test #12:
score: 0
Accepted
time: 3ms
memory: 4708kb
input:
100000 75636237219086009 1 37818118609543001 12606039536514334 6303019768257167 3781811860954300 2521207907302866 1800862790930619 1350647093197964 1050503294709528 840402635767622 687602156537145 573001797114288 484847674481320 415583720983989 360172558186124 315150988412858 278074401540757 2471772...
output:
100000
result:
ok single line: '100000'
Test #13:
score: 0
Accepted
time: 6ms
memory: 4352kb
input:
100000 236447379349717830 1 118223689674858912 39407896558286304 19703948279143152 11822368967485891 7881579311657261 5629699508326615 4222274631244961 3283991379857192 2627193103885753 2149521630451980 1791268025376650 1515688329164858 1299161424998449 1125939901665323 985197413957157 8692918358445...
output:
100000
result:
ok single line: '100000'
Test #14:
score: 0
Accepted
time: 3ms
memory: 4596kb
input:
100000 238284828602599618 1 119142414301299807 39714138100433269 19857069050216634 11914241430129980 7942827620086654 5673448300061895 4255086225046421 3309511508369439 2647609206695551 2166225714569087 1805188095474239 1527466850016664 1309257300014283 1134689660012379 992853452510832 8760471639801...
output:
100000
result:
ok single line: '100000'
Test #15:
score: 0
Accepted
time: 3ms
memory: 4456kb
input:
100000 209481399482344513 1 104740699741172255 34913566580390751 17456783290195376 10474069974117225 6982713316078150 4987652368627250 3740739276470437 2909463881699229 2327571105359383 1904376358930404 1586980299108670 1342829483861183 1150996700452442 997530473725450 872839164509769 77015220397920...
output:
100000
result:
ok single line: '100000'
Test #16:
score: 0
Accepted
time: 3ms
memory: 4708kb
input:
100000 160284526594608875 1 80142263297304436 26714087765768145 13357043882884073 8014226329730443 5342817553153629 3816298252252592 2862223689189444 2226173980480679 1780939184384543 1457132059950989 1214276716625825 1027464914068005 880684212058290 763259650450518 667852194144203 589281347774297 5...
output:
100000
result:
ok single line: '100000'
Test #17:
score: 0
Accepted
time: 3ms
memory: 4272kb
input:
100000 852095496567419553 1 426047748283709776 142015916094569925 71007958047284962 42604774828370977 28403183218913985 20287988013509989 15215991010132492 11834659674547494 9467727739637995 7746322696067450 6455268913389542 5462150619021920 4681843387733074 4057597602701998 3550397902364248 3132704...
output:
100000
result:
ok single line: '100000'
Test #18:
score: 0
Accepted
time: 3ms
memory: 4416kb
input:
100000 787884515487196686 1 393942257743598343 131314085914532781 65657042957266390 39394225774359834 26262817182906556 18759155130647540 14069366347985655 10942840492877731 8754272394302185 7162586504429061 5968822087024217 5050541765943568 4329035799380201 3751831026129508 3282852147863319 2896634...
output:
100000
result:
ok single line: '100000'
Test #19:
score: 0
Accepted
time: 4ms
memory: 4320kb
input:
100000 705443926439369243 1 352721963219684622 117573987739894874 58786993869947437 35272196321968462 23514797547978974 16796283962842125 12597212972131593 9797832311657906 7838265849326325 6413126603994266 5344272169995221 4522076451534418 3876065529886644 3359256792568425 2939349693497372 25935438...
output:
1
result:
ok single line: '1'
Test #20:
score: 0
Accepted
time: 3ms
memory: 4596kb
input:
100000 400695253982082795 1 200347626991041398 66782542330347133 33391271165173566 20034762699104140 13356508466069426 9540363190049590 7155272392537193 5565211860862261 4452169488689809 3642684127109843 3035570105924869 2568559320397966 2201622274626828 1908072638009918 1669563558258678 14731443161...
output:
1
result:
ok single line: '1'
Test #21:
score: 0
Accepted
time: 4ms
memory: 4388kb
input:
100000 954649278647157019 1 477324639323578511 159108213107859503 79554106553929752 47732463932357851 31821642621571900 22729744729694215 17047308547270661 13259017758988292 10607214207190633 8678629805883245 7232191504902704 6119546657994596 5245325706852511 4545948945938843 3977705327696487 350973...
output:
1
result:
ok single line: '1'
Test #22:
score: 0
Accepted
time: 4ms
memory: 4456kb
input:
100000 827879037502813038 1 413939518751406518 137979839583802173 68989919791901086 41393951875140652 27595967916760434 19711405654828882 14783554241121661 11498319965316847 9198655972253478 7526173068207391 6271810890172826 5306916907069314 4548785920345126 3942281130965776 3449495989595054 3043672...
output:
214
result:
ok single line: '214'
Test #23:
score: 0
Accepted
time: 4ms
memory: 4456kb
input:
100000 547920341258674169 1 273960170629337084 91320056876445694 45660028438222847 27396017062933708 18264011375289139 13045722410920813 9784291808190610 7610004739703808 6088003791763046 4981094011442492 4150911676202077 3512309879863296 3010551325597111 2609144482184162 2283001421911142 2014413019...
output:
74
result:
ok single line: '74'
Test #24:
score: 0
Accepted
time: 0ms
memory: 4452kb
input:
100000 859719130041796908 1 429859565020898453 143286521673632818 71643260836816409 42985956502089845 28657304334726563 20469503096233259 15352127322174945 11940543472802735 9552434778242188 7815628454925426 6513023712437855 5511020064370493 4723731483746137 4093900619246652 3582163041840820 3160732...
output:
322
result:
ok single line: '322'
Test #25:
score: 0
Accepted
time: 4ms
memory: 4300kb
input:
100000 771358528927320765 1 385679264463660382 128559754821220127 64279877410610063 38567926446366038 25711950964244025 18365679260174304 13774259445130728 10713312901768344 8570650321414675 7012350262975643 5843625219146369 4944605954662312 4238233675424839 3673135852034861 3213993870530503 2835876...
output:
54
result:
ok single line: '54'
Test #26:
score: 0
Accepted
time: 0ms
memory: 4272kb
input:
100000 301578483639376708 1 150789241819688353 50263080606562784 25131540303281392 15078924181968835 10052616121312557 7180440086651826 5385330064988870 4188590050546898 3350872040437519 2741622578539788 2284685482116490 1933195407944722 1657024635381190 1436088017330365 1256577015164069 11087444251...
output:
381
result:
ok single line: '381'