結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2017-03-18 21:09:40 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 606 bytes |
コンパイル時間 | 2,881 ms |
コンパイル使用メモリ | 74,348 KB |
実行使用メモリ | 41,632 KB |
最終ジャッジ日時 | 2024-07-04 19:32:45 |
合計ジャッジ時間 | 6,512 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 1 |
ソースコード
import java.util.Scanner; public class Robo { public static void main(String[] args) { Scanner s = new Scanner(System.in); int X = s.nextInt(), Y = s.nextInt(), L = s.nextInt(), count = 0; s.close(); if(Y >= 0){ count += COUNT(Y, L, count); if(X != 0){ count += COUNT(X,L,count) + 1; } }else{ if(X != 0){ count += COUNT(X,L,count) + 1; count += COUNT(Y,L,count) + 1; } } System.out.println(count); } static int COUNT(int p,int k, int count){ if(p%k == 0){ count = Math.abs(p/k); }else{ count = Math.abs(p/k) + 1; } return count; } }