結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
8130Tsk
|
| 提出日時 | 2015-07-27 19:04:59 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 624 bytes |
| 記録 | |
| コンパイル時間 | 3,892 ms |
| コンパイル使用メモリ | 74,940 KB |
| 実行使用メモリ | 57,932 KB |
| 最終ジャッジ日時 | 2024-07-16 04:13:55 |
| 合計ジャッジ時間 | 8,066 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 9 |
ソースコード
import java.util.Scanner;
public class No48 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int l = sc.nextInt();
x=Math.abs(x);
y=Math.abs(y);
int mx,my;
if(x%l==0){
mx=x/l;
}else{
mx=x/l+1;
}
if(y%l==0){
my=y/l;
}else{
my=y/l+1;
}
if(x == 0&&y == 0){
System.out.println(0);
}else if(x == 0 && y < 0){
System.out.println(my + 1);
}else if(x != 0 && y==0){
System.out.println(mx);
}else{
System.out.println(mx+my+1);
}
}
}
8130Tsk