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 1295. Crazy Notions

WA#14
Posted by Enigma 5 Nov 2010 11:35
I can't understand Why I got "Wrong Answer" in TEST#14......? Give me some tests !!!!!
This is my code.---
import java.util.Scanner;

public class T_1295 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if(n==1){
            System.out.println(1);
            return;
        }
        if(n%4==1 || n%4==3){
            System.out.println(2);
            return;
        }
        if(n%4==0){
            System.out.println(0);
            return;
        }
        if(n%4==2){
            System.out.println(1);
            return;
        }
    }
}
Re: WA#14
Posted by hoan 24 Nov 2010 19:04
try this test:
input:
9

output:
1

hint: there is not a rule for n which (n%4== 1).
look at this test:
input:
5

output:
2

sorry for my poor english.

GOOD LUCK!!!

Edited by author 24.11.2010 19:05