|
|
back to boardWA#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 |
|
|