|
|
back to boardAccepted wrong code? Posted by lilica 20 Mar 2011 00:54 I submitted this code, and it was accepted, though if n=2 and k=5, the answer is 1, which is impossible import java.io.*; import java.util.*; public class ch1 { public static void main(String args[]) throws ArithmeticException{ Scanner in =new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); long N = in.nextLong(); long K = in.nextLong(); N=2*N; if(N==2) out.print(2); else if(N%K==0) out.print(N/K); else out.print(N/K+1);
out.flush(); in.close(); out.close(); } } |
|
|