大佬来解释一下 80分

P1319 压缩技术

_LiM @ 2017-10-06 14:57:56

求DALAO指错

#include<iostream>
#include<cstring>
#include<cstdio>
inline long long read(){
    long long f=1,x=0;char ch;
    do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');
    do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');
    return f*x;
}
long long z[10010],o[10010],cnt,i,n;
using namespace std;
int main()
{
    n=read();
    for(i=0;i<n;i++)
    cin>>z[i]>>o[i];
    for(i=0;i<n;i++)
    {
        while(z[i])
        {
            cout<<"0";
            cnt++;
            if(cnt==n)
            {
                cout<<endl;
                cnt=0;
            }
            z[i]--;
        }
        while(o[i])
        {
            cout<<"1";
            cnt++;
            if(cnt==n)
            {
                cout<<endl;
                cnt=0;
            }
            o[i]--;
        } 
    }
    return 0;
}

80分,过不去三四点


by woshishei @ 2017-10-06 15:00:32

呵呵


|