HUST Online Judge WebBoard
Problem 4067 >> 答案错误50%
201803140220 @ 2019-05-22 22:27:57
[ Quote ] [ Edit ] [ Delete ] 1#
#include <stdio.h>
#include <string.h>

int main()
{
char N[1100];
long long i,t=0;
long long sum,num,cnt,len;

while(gets(N)!=NULL)
{
len=strlen(N);

sum=num=cnt=0;

for(i=0;i<len;i++)
{
t=N[i]-48;

if(t>2)
sum=(sum-cnt)*10+cnt*(t+1)+num*2+2;
else
sum=(sum-cnt)*10+cnt*(t+1)+num*2+t;

num=num*10+t;

if(t==1 || t==2)
cnt++;

num=num%20123;
sum=sum%20123;
}
printf("%lld\n",sum);
}
return 0;
}

/**************************************************************
Problem: 4067
User: 201803140220
Language: C
Result: 答案错误
****************************************************************/
admin @ 2019-05-27 16:58:43
[ Quote ] [ Edit ] [ Delete ] 2#
测试数据出错。已重判。