ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1048. Superlong Sums

AC Solve. It's problem is very easy!!
Posted by XSpider 26 Mar 2008 01:18
That is my AC solve.
#include <stdio.h>
char a[1000005], b[1000005];
int Count, min;
int main()
{ scanf("%d", &Count);
  min=1;
  for (int i=1; i<=Count; i++)
    scanf("%d %d", &a[i], &b[i]);
// summing
  for (int i=Count; i>=0; i--)
    { int temp = a[i] + b[i];
      a[i] = temp%10;
      a[i-1] += temp/10;
    }
  if (a[0] == 1) min--;
  for (int i=min; i<=Count; i++)
    printf("%d", a[i]);
        return 0;
}
Re: AC Solve. It's problem is very easy!!
Posted by Alex 14 Aug 2017 17:38
I wrote the same code on C#, but it was TLE on test#4!
So, i send your code.
Thank you.