#7037: Why RE?


yatsen (愛情少校)


#include <stdio.h>
#include <string.h>
char s[100000000];
int main()
{
    int i,flag,count,maxspace;
    while(gets(s))
    {
        if(s[0]==' ')
            flag=count=1;
        else
            flag=count=0;

        for(maxspace=0,i=1; s[i]; i++)
        {
            if(s[i]==' ')
            {
                if(flag) count++;
                else flag=count=1;
            }
            else
            {
                if(count>maxspace) maxspace=count;
                flag=count=0;
            }
        }
        for(count=0; maxspace>1; count++)
            maxspace=(maxspace+1)/2;
        printf("%d\n",count);
    }
    return 0;
}
#7041: Re:Why RE?


passerr (20130326 0340 48)


你把

char s[100000000];

改成

char s[2500];

看看

(或許還能更小?)

#8217: Re:Why RE?


cuh127 (futurhack~~~~~興國猩國也(絕對沒有在污辱女性))


你把

char s[100000000];

改成

char s[2500];

看看

(或許還能更小?)

爲什麼題目要寫出輸入小於1MB嚇人??