| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:Accepted 1132K 1344MS C++ 298BIn Reply To:Accepted 1132K 1344MS C++ 298B Posted by:wenhua2199 at 2009-08-23 00:22:19 我这个超时,不知道怎么回事啊
#include<iostream>
using namespace std;
int a,b[1000001],n,i;
int main()
{
cin>>n;
for(i=n-1;i>=0;i--)
{
scanf("%d %d",&a,&b[i]);
b[i]+=a;
}
for(i=0;i<n;i++)
{
if(b[i]>9){b[i]-=10;b[i+1]+=1;}
}
if(b[n]==1)n++;
for(i=n-1;i>=0;i--) printf("%d",b[i]);
printf("\n");
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator