結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2015-04-03 03:56:26 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 130 ms / 5,000 ms |
コード長 | 916 bytes |
コンパイル時間 | 4,041 ms |
コンパイル使用メモリ | 75,824 KB |
実行使用メモリ | 41,612 KB |
最終ジャッジ日時 | 2024-11-21 18:17:14 |
合計ジャッジ時間 | 7,053 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
//No.48 ロボットの操縦 import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class No48 { static final Scanner sc = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { int x = sc.nextInt(); int y = sc.nextInt(); int l = sc.nextInt(); int ans = (x == 0 && y >= 0 ? 0 : (y >= 0 ? 1 : 2)); x = abs(x); y = abs(y); ans += x/l + (x%l == 0 ? 0 : 1) + y/l + (y%l == 0 ? 0 : 1); out.println(ans); } public static void main(String[] args) { long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); //trace(end-start + "ms"); sc.close(); } static void trace(Object... o) { System.out.println(deepToString(o));} }