QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#403467 | #7747. Memory | ucup-team3160# | AC ✓ | 6ms | 8416kb | C++14 | 14.0kb | 2024-05-02 13:37:03 | 2024-05-02 13:37:04 |
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,int &x,int &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 20005
#define M 1000005
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 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));memset(buc,0,(m+1)<<2);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,a[100005],b[100005];
int sgn(int x)
{
return x>0?1:x<0?-1:0;
}
signed main()
{
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
int flag=0,lst=0;
for(int i=1;i<=n;i++)
{
a[i]+=a[i-1]/2; a[i-1]%=2;
b[i-1]=a[i-1];
if(b[i-1])
{
lst=sgn(b[i-1]);
}
if(a[i])
{
flag=sgn(a[i]);
}
else
{
flag=lst;
}
if(!flag) cout<<"0"; else if(flag>0) cout<<"+"; else cout<<"-";
}
cout<<endl;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 5744kb
input:
10 2 -1 4 -7 4 -8 3 -6 4 -7
output:
+0+-+---+-
result:
ok single line: '+0+-+---+-'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
10 -1 36 18 18 18 18 18 18 18 -18
output:
-++++++++-
result:
ok single line: '-++++++++-'
Test #3:
score: 0
Accepted
time: 0ms
memory: 7916kb
input:
1000 -1 193552 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 967...
output:
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
result:
ok single line: '-+++++++++++++++++++++++++++++...++++++++++++++++++++++++++++++-'
Test #4:
score: 0
Accepted
time: 2ms
memory: 5384kb
input:
100000 -1 696082628 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 348041314 ...
output:
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
result:
ok single line: '-+++++++++++++++++++++++++++++...++++++++++++++++++++++++++++++-'
Test #5:
score: 0
Accepted
time: 0ms
memory: 8044kb
input:
10 -1 70 -35 -72 36 12 -6 42 -21 -84
output:
-+---+-+--
result:
ok single line: '-+---+-+--'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
1000 -1 -120742 60371 -567374 283687 -507718 253859 -579246 289623 21402 -10701 539474 -269737 -681332 340666 -746052 373026 -993382 496691 -333880 166940 -632724 316362 909690 -454845 86680 -43340 236688 -118344 -29102 14551 6252 -3126 -440612 220306 -878460 439230 649538 -324769 -651632 325816 882...
output:
---------+-+-----------+-+-+---+-----+---+-+-+---+-+-+-+-+---+-----+-----+---+-+-----+-----+-+-+---+---+-+-----+-------+-+---+-----+-+-+-------+-+-+-+-+-------+-----+-+-+-------+-------+-+-+-------+---+-+---+-+---+-+-+-+---+-+-+-+-+---------+-----+-----+-+-+-+-+-+-+-+---+-+-+-------+---+-+-+-+-+-+--...
result:
ok single line: '---------+-+-----------+-+-+--...+---+-+-+-+-+-----+-+---------+'
Test #7:
score: 0
Accepted
time: 0ms
memory: 7252kb
input:
100000 -1 126247070 -63123535 -440273040 220136520 809537358 -404768679 -927404550 463702275 896759686 -448379843 155450002 -77725001 995415070 -497707535 -730811632 365405816 -223816910 111908455 255855870 -127927935 -78358522 39179261 190117110 -95058555 -61118274 30559137 243732804 -121866402 -48...
output:
-+---+---+-+-+-----+---+---+-------+-+-+---+-----+---+-+-+-----+-+-----+-----+-+---+-+---+---+-+-+-+-+-----------+---+-+-+-------+-+-+---+-----+-------+-+---+-+---------------+-----------------+-+-----+-+-+---+-+-+-+---+-+-----+-+-+---+-+-----+-+-+-----+-----+-+-+-----+-+-+-----+-+---+-+---+-+-+-+--...
result:
ok single line: '-+---+---+-+-+-----+---+---+--...--+-+-+---+---+---+---+-+------'
Test #8:
score: 0
Accepted
time: 1ms
memory: 7832kb
input:
10 0 2 -1 88 -44 14 -7 -32 16 32
output:
0+0+0+0-0+
result:
ok single line: '0+0+0+0-0+'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
1000 0 804678 -402339 501804 -250902 701336 -350668 341920 -170960 234558 -117279 138082 -69041 383094 -191547 613608 -306804 -173632 86816 105660 -52830 268340 -134170 -786944 393472 -702908 351454 236550 -118275 83428 -41714 280776 -140388 -743190 371595 -762656 381328 -873564 436782 565326 -28266...
output:
0+0+0+0+0+0+0+0+0-0+0+0-0-0+0+0+0-0-0-0+0+0-0-0+0+0-0+0-0+0-0+0-0-0-0+0+0+0-0+0+0-0-0+0+0+0-0+0-0-0+0-0-0-0-0-0+0-0+0-0-0-0+0-0+0-0+0+0-0+0-0+0-0+0-0-0+0+0-0+0-0+0-0+0-0+0+0+0-0+0-0-0-0+0+0-0+0+0+0+0+0-0+0-0+0-0+0+0-0-0-0+0+0+0+0-0+0-0-0+0+0-0-0+0+0+0-0+0+0-0+0-0+0+0-0+0-0+0+0+0-0+0-0-0-0-0-0+0-0+0+...
result:
ok single line: '0+0+0+0+0+0+0+0+0-0+0+0-0-0+0+...-0-0+0+0+0-0-0-0-0-0+0-0+0-0+0+'
Test #10:
score: 0
Accepted
time: 5ms
memory: 7132kb
input:
100000 0 281054714 -140527357 181299510 -90649755 -155852956 77926478 804466996 -402233498 100794828 -50397414 -498194394 249097197 674196350 -337098175 947822240 -473911120 649015454 -324507727 -445192880 222596440 517778906 -258889453 580158794 -290079397 -634780702 317390351 -689237014 344618507 ...
output:
0+0+0-0+0+0-0+0+0+0-0+0+0-0-0-0+0-0-0+0+0-0-0+0+0+0+0+0-0+0+0-0-0-0+0+0+0-0+0+0-0-0-0-0-0-0+0+0-0-0+0+0-0+0+0+0+0-0+0-0-0+0+0-0+0-0-0+0+0-0+0+0+0-0+0+0+0-0+0-0-0+0-0-0-0-0-0-0+0-0-0-0+0-0-0+0+0+0+0-0-0+0-0+0-0+0+0-0+0-0+0-0+0+0+0-0-0+0-0+0-0+0+0-0+0+0+0+0+0+0+0-0+0-0+0+0+0-0-0-0+0-0+0-0-0+0-0-0-0-0-...
result:
ok single line: '0+0+0-0+0+0-0+0+0+0-0+0+0-0-0-...-0-0-0+0+0-0+0+0+0+0+0-0-0-0+0-'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
10 1 96 -48 -50 25 38 -19 -16 8 64
output:
+++-+++-++
result:
ok single line: '+++-+++-++'
Test #12:
score: 0
Accepted
time: 1ms
memory: 5964kb
input:
1000 1 -233282 116641 245142 -122571 -866732 433366 342040 -171020 -114326 57163 -723670 361835 559940 -279970 47632 -23816 -546562 273281 -677060 338530 189622 -94811 206166 -103083 -354146 177073 -503094 251547 671860 -335930 -810126 405063 -743936 371968 -799120 399560 579380 -289690 -829990 4149...
output:
+-+++-+++-+-+++++-+-+++++-+-+++-+-+-+++-+++-+++++++++++++++-+-+-+++++++++++++++++-+-+-+++++-+-+-+++++++++++++-+++++-+-+-+-+++++-+-+-+++-+++-+-+-+++++-+-+-+++-+++-+++++++-+-+++-+++-+-+-+++-+++-+-+-+++-+-+-+++-+++++-+-+++-+-+-+++++++++++++-+-+-+++-+++-+++++-+++++++++-+-+++++-+++-+-+++-+-+-+-+-+-+-+-+-...
result:
ok single line: '+-+++-+++-+-+++++-+-+++++-+-++...++-+++++-+++++-+-+++++-+-+++++-'
Test #13:
score: 0
Accepted
time: 5ms
memory: 6752kb
input:
100000 1 -836242278 418121139 779823668 -389911834 456274226 -228137113 -468926922 234463461 -674503678 337251839 -167236416 83618208 217124940 -108562470 83590374 -41795187 888634130 -444317065 -477073058 238536529 -539286006 269643003 593019232 -296509616 983037312 -491518656 -730801390 365400695 ...
output:
+-+++++-+-+-+++++++-+-+++++-+++-+++++++-+++-+++++++++-+++++++-+-+-+++++++++++-+-+-+-+-+-+++-+-+-+-+++-+++-+++-+++++++++++++++++++-+++-+-+-+-+++++++-+++-+-+-+++-+++-+++++++-+-+++++-+-+++-+-+++++-+-+++-+-+++-+-+++++++-+++++++++-+-+++-+++++++-+-+++++++-+-+-+++-+++-+-+++-+-+-+-+++-+-+-+-+-+-+++-+++++++-...
result:
ok single line: '+-+++++-+-+-+++++++-+-+++++-++...++-+++++-+-+-+++++++-+-+-+++++-'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
10 1 -92 -46 -46 -46 -46 -46 -46 -46 46
output:
+--------+
result:
ok single line: '+--------+'
Test #15:
score: 0
Accepted
time: 1ms
memory: 7928kb
input:
1000 1 -236388 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -118194 -1181...
output:
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------...
result:
ok single line: '+-----------------------------...------------------------------+'
Test #16:
score: 0
Accepted
time: 4ms
memory: 8416kb
input:
100000 1 -341428024 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -170714012 -1707...
output:
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------...
result:
ok single line: '+-----------------------------...------------------------------+'
Test #17:
score: 0
Accepted
time: 2ms
memory: 6756kb
input:
100000 -480901673 -509307600 -562561206 -720747466 941874932 -338344843 -453928087 355126643 -42193930 344068464 -358448536 132560523 166795837 314061531 487526745 -156787355 611354631 116338982 -466559641 -310495789 -368174169 729138 -202574892 -453653662 -893218259 827601754 128423870 -106094115 7...
output:
----+--+++-+++++++-------+++++---++-+----++++----++++----+++++++++------++-----+++++++++--++++-++++----+-+-++----+++--+-+++--------+-++-++++-------+++++-------------+-++---+-----++--+----+------+-+-++++-+++++-+--+++---+----++++---+++----+-+-+-------++-+-+-----++-++++++-+--++-+-+++-+-++++++--++-----+...
result:
ok single line: '----+--+++-+++++++-------+++++...--++-++-+---+-++---++-++++-++++'
Test #18:
score: 0
Accepted
time: 2ms
memory: 6924kb
input:
100000 401801336 -153873233 -245401319 57736118 -371480661 -7386866 -962876999 -509105223 -97542547 312188284 -825578860 197298463 -215386150 -894478467 184851706 -973780424 -155743919 405442471 -448475678 509920273 119901780 330459500 -494037860 -200311269 791000901 -661046994 634125416 890073378 -...
output:
++-------+-------+-+++--+-++-++++++----------+-+------+--++-++++++++-+++++--++++--+-+++---++-+--++++-++---+--+----+++-+----++++-----+---++-----++-----++++++-++--+-----+++-----++++-++-+-------+-+++-+----+-++--+---+-----++++--++-++++-+++++++++--------------+-+++++++++++-++-+-----++--+--+++++-------+++...
result:
ok single line: '++-------+-------+-+++--+-++-+...+++--+--++++++----+----++++----'
Test #19:
score: 0
Accepted
time: 2ms
memory: 8096kb
input:
100000 -125561068 496528427 123636069 784342199 315163748 28603817 875018886 626662912 680133215 575275399 412323523 210158900 -892535431 -641075550 715201047 209226508 539100445 -138478419 -725359009 -374696372 902945022 417100071 -542411037 347998418 232130268 -392785534 -565205746 -460603926 -584...
output:
-+++++++++++--++++--++-++------++-+-----+-----+----+-+++-----++---+++-++++++++------------+++------+++++--+++-+++--++++-+++-+--------++-------++++-+--------++--+-++--+-+---+-+--+++++-+--+-----+-++-+++++-++++++++++-+-++--+++---++++-----++++++-+-+-+++-++++++--+++++--+--+-+++----------+--+--++++++-----...
result:
ok single line: '-+++++++++++--++++--++-++-----...+++++++++------++---+-+--------'
Test #20:
score: 0
Accepted
time: 6ms
memory: 8332kb
input:
100000 757141941 851962794 440795956 -194084426 -460134759 116472002 366069975 -237568954 -785280815 838362513 -644741390 274896840 725282583 150384453 412526008 -902733855 -227998106 -144342224 -707275045 983776776 -557101528 503740642 -833874006 601340812 -378617867 -714458662 -59504201 483686065 ...
output:
++++--+--+-++++----+-+-+---+----++-+-++++-+++++++++-++--+-+++++-++--++-----++-----+++++-+++++----++-+--+++--++++-++++-+------++-++------+++-+----------++++++++-+++++--+------++-++--+++--++-+-+-++++--++++++++-+-+-----+-----++---+-+-+++++++-+--+--++-++-++--+-++++---+--+--++-+++++----+++---+++---++--++...
result:
ok single line: '++++--+--+-++++----+-+-+---+--...---+++++++-++------------+----+'
Extra Test:
score: 0
Extra Test Passed