結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             mits58
                         | 
                    
| 提出日時 | 2016-07-02 20:30:08 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 432 bytes | 
| コンパイル時間 | 2,580 ms | 
| コンパイル使用メモリ | 73,708 KB | 
| 実行使用メモリ | 41,500 KB | 
| 最終ジャッジ日時 | 2024-10-12 01:16:30 | 
| 合計ジャッジ時間 | 6,358 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 24 WA * 1 | 
ソースコード
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int x=sc.nextInt();
			int y=sc.nextInt();
			int l=sc.nextInt();
			int ans=0;
			if(x!=0) ans+=(Math.abs(x)+l-1)/l;
			if(y!=0) ans+=(Math.abs(y)+l-1)/l;
			if(y>0 && x!=0) ans++;
			else if(y<0 && x!=0) ans+=2;
			else if(y==0 && x!=0) ans++;
			System.out.println(ans);
		}
	}
}
            
            
            
        
            
mits58