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 2031. Overturned Numbers

ahmetov14 Why WA1? // Problem 2031. Overturned Numbers 7 Nov 2016 22:26
int n = in.nextInt();
        int l = 0;
        if (n > 24) {
            out.print("Glupenky Pierre");
        } else {
            for (int i = 1; i <= n; i++) {
                if (i / 5 == 0)
                    l = 0;
                if (i / 5 == 1)
                    l = 1;
                if (i / 5 == 2)
                    l = 8;
                if (i / 5 == 3)
                    l = 6;
                if (i / 5 == 4)
                    l = 9;

                if (i % 5 == 0)
                    l = l * 10;
                if (i % 5 == 1)
                    l = l * 10 + 1;
                if (i % 5 == 2)
                    l = l * 10 + 8;
                if (i % 5 == 3)
                    l = l * 10 + 6;
                if (i % 5 == 4)
                    l = l * 10 + 9;
                if (l/10==0)
                    out.print("0");
                out.print(l);
                out.print(" ");
            }
        }

Edited by author 07.11.2016 22:26

Edited by author 07.11.2016 22:27