結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
kou6839
|
| 提出日時 | 2014-11-19 13:30:44 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 5,000 ms |
| コード長 | 533 bytes |
| 記録 | |
| コンパイル時間 | 2,340 ms |
| コンパイル使用メモリ | 81,688 KB |
| 実行使用メモリ | 42,724 KB |
| 最終ジャッジ日時 | 2026-05-15 21:56:08 |
| 合計ジャッジ時間 | 4,999 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x= sc.nextInt();
int y=sc.nextInt();
double l=sc.nextDouble();
int ans=0;
if(x==0&&y==0){
System.out.println(0);
return;
}
if(y>=0){
ans+=(int)Math.ceil(y/l);
if(x!=0){
ans+=1+(int)Math.ceil(Math.abs(x)/l);
}
}else{
ans=(int)Math.ceil(Math.abs(y)/l);
ans+=2+(int)Math.ceil(Math.abs(x)/l);
}
System.out.println(ans);
}
}
kou6839