結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2017-12-17 21:24:07 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 793 bytes | 
| コンパイル時間 | 1,017 ms | 
| コンパイル使用メモリ | 111,384 KB | 
| 実行使用メモリ | 26,064 KB | 
| 最終ジャッジ日時 | 2024-12-15 22:57:20 | 
| 合計ジャッジ時間 | 2,233 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 17 WA * 8 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.IO;
using System.Linq;
namespace yukicore
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            int count = 0;
            int x = Math.Abs(int.Parse(Console.ReadLine()));
            int y = Math.Abs(int.Parse(Console.ReadLine()));
            int dist = int.Parse(Console.ReadLine());
            if (x == 0 || y == 0)
                count = 0;
            else
                count = 1;
            count += upper(1.0 * x / dist);
            count += upper(1.0 * y / dist);
            Console.WriteLine(count);
        }
        static int upper(double n)
        {
            if (n % 1 == 0)
                return(int) n;
            else
                return(int) Math.Floor(n) + 1;
        }
    }
}