結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2016-05-30 20:18:08 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 449 bytes |
コンパイル時間 | 1,915 ms |
コンパイル使用メモリ | 75,000 KB |
実行使用メモリ | 54,256 KB |
最終ジャッジ日時 | 2024-10-07 18:51:33 |
合計ジャッジ時間 | 5,622 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 WA * 2 |
ソースコード
import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int X = Integer.parseInt(sc.next()); int Y = Integer.parseInt(sc.next()); int L = Integer.parseInt(sc.next()); int ans = (Math.abs(X)+L-1)/L + (Math.abs(Y)+L-1)/L; if(Y>=0){ if(X!=0){ ans++; } } else{ ans = ans + 2; if(X!=0){ if(X>0){ ans++; } } } System.out.println(ans); } }