結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2019-02-14 23:28:03 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 522 bytes |
コンパイル時間 | 2,052 ms |
コンパイル使用メモリ | 73,844 KB |
実行使用メモリ | 54,248 KB |
最終ジャッジ日時 | 2024-09-13 11:36:02 |
合計ジャッジ時間 | 6,309 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 WA * 2 |
ソースコード
import java.util.*; class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int x = sc.nextInt(); int y = sc.nextInt(); int L = sc.nextInt(); int ans = 0; if (y >= 0) ans += 1; else if (y < 0) ans += 2; // System.out.println(":"+ans); if (x%L == 0) ans += Math.abs(x/L); else ans += Math.abs(x/L) + 1; // System.out.println(":"+ans); if (y%L == 0) ans += Math.abs(y/L); else ans += Math.abs(y/L) + 1; System.out.println(ans); } }