結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
AoiroFukurou
|
| 提出日時 | 2014-12-21 17:54:47 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 524 bytes |
| 記録 | |
| コンパイル時間 | 3,507 ms |
| コンパイル使用メモリ | 82,220 KB |
| 実行使用メモリ | 47,716 KB |
| 最終ジャッジ日時 | 2026-03-05 06:51:20 |
| 合計ジャッジ時間 | 4,701 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 7 |
ソースコード
package benkyoukai;
import java.util.Scanner;
public class Robot {
public static void main(String[] args) {
int x, y, l;
int ans=0;
Scanner sc = new Scanner(System.in);
x = sc.nextInt();
y = sc.nextInt();
l = sc.nextInt();
x=Math.abs(x);
if(y==0){
if(x==0){
ans = 0;
}else{
ans = (x + l -1)/l+1;
}
}
if(y>0){
ans = (y+l-1)/l;
if(x!=0){
ans +=1+(x+l-1)/l;
}
}
if(y<0){
ans = (y+l-1)/l;
if(x==0){
ans +=2;
}else{
ans +=(2+(x+l-1)/l);
}
}
System.out.println(ans);
}
}
AoiroFukurou