結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             8130Tsk
                         | 
                    
| 提出日時 | 2015-07-27 18:57:09 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 621 bytes | 
| コンパイル時間 | 3,087 ms | 
| コンパイル使用メモリ | 75,040 KB | 
| 実行使用メモリ | 55,820 KB | 
| 最終ジャッジ日時 | 2024-07-16 04:13:42 | 
| 合計ジャッジ時間 | 6,959 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 17 WA * 8 | 
ソースコード
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);
		}else if(x != 0 && y==0){
			System.out.println(mx);
		}else{
			System.out.println(mx+my+1);
		}
		
		
	}
		
}
            
            
            
        
            
8130Tsk