結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2017-12-01 12:38:02 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 703 bytes |
コンパイル時間 | 3,289 ms |
コンパイル使用メモリ | 77,032 KB |
実行使用メモリ | 41,748 KB |
最終ジャッジ日時 | 2024-11-27 21:26:34 |
合計ジャッジ時間 | 8,082 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 9 |
ソースコード
import java.util.Scanner; public class No48 { public static void main(String[]args) { Scanner sc =new Scanner(System.in); int X,Y,L,cnt; X = sc.nextInt(); Y = sc.nextInt(); L = sc.nextInt(); cnt=0; if(Y>=0) { while(Y>0) { Y=Y-L; cnt++; } if(X>=0) { cnt++; while(X>0) { X=X-L; cnt++; } } else { cnt++; X=(-1)*X; while(X>0) { X=X-L; cnt++; } } } else { Y=(-1)*Y; while(Y>0) { Y=Y-L; cnt++; } if(X>=0) { cnt++; while(X>0) { X=X-L; cnt++; } } else { cnt++; X=(-1)*X; while(X>0) { X=X-L; cnt++; } } } System.out.println(cnt); } }