結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2019-02-14 23:29:12 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 534 bytes |
コンパイル時間 | 2,064 ms |
コンパイル使用メモリ | 73,932 KB |
実行使用メモリ | 54,268 KB |
最終ジャッジ日時 | 2024-09-13 11:36:09 |
合計ジャッジ時間 | 6,367 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 1 |
ソースコード
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 && x!=0) ans += 1; else if (y<0 && x!=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); } }