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

I first get WA, and now is TLE, I even didn't changed my program!
Posted by Standlove 7 Jan 2003 18:50
Is the juge bad??

here is my program:
someone who accepted can check it??
Thanks for your kindness!

#include <iostream>
using namespace std;

int N;

int main()
{
    int r1, r2, wait = -1;
    int nines = 0;

    cin >> N;
    for (int i = 0; i < N; ++i)
    {
        cin >> r1 >> r2;
        if (r1 + r2 != 9)
        {
            if (r1 + r2 > 9) {
                cout << wait + 1;
                while (nines > 0) {
                    cout << 0;
                    --nines;
                }
            }
            else {
                if (wait != -1)
                    cout << wait;
                while (nines > 0) {
                    cout << 9;
                    --nines;
                }
            }
            wait = (r1 + r2) % 10;
        }
        else {
            nines++;
        }
    }
    //
    if (wait != -1)
        cout << wait;

    while (nines > 0) {
        cout << 9;
        --nines;
    }
    cout << endl;
    //
    return 0;
}
I got it! So don't waste your time on it.
Posted by Standlove 9 Jan 2003 12:36