結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2014-11-30 22:58:49 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 495 bytes |
コンパイル時間 | 5,376 ms |
コンパイル使用メモリ | 74,980 KB |
実行使用メモリ | 41,720 KB |
最終ジャッジ日時 | 2024-06-11 07:32:10 |
合計ジャッジ時間 | 6,498 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 WA * 2 |
ソースコード
import java.util.Scanner; public class Main48 { public static void main(String[] args) { Main48 p = new Main48(); } public Main48() { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int l = sc.nextInt(); solve(x, y, l); } public void solve(int x, int y, int l) { int res = (Math.abs(x)-1)/l + 1 + (Math.abs(y)-1)/l + 1; if(y<0) res+=2; else if(Math.abs(x)>0) res++; System.out.println(res); } }