Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:Accepted 1132K 1344MS C++ 298B

Posted by qianwei at 2010-07-05 01:31:22 on Problem 2602 and last updated at 2010-07-05 01:35:19
In 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator