結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
kou6839
|
| 提出日時 | 2014-11-19 13:27:42 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 480 bytes |
| コンパイル時間 | 2,055 ms |
| コンパイル使用メモリ | 76,088 KB |
| 実行使用メモリ | 42,488 KB |
| 最終ジャッジ日時 | 2025-01-02 19:12:22 |
| 合計ジャッジ時間 | 6,185 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 1 |
ソースコード
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(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);
if(x!=0){
ans+=2+(int)Math.ceil(Math.abs(x)/l);
}
}
System.out.println(ans);
}
}
kou6839