結果

問題 No.48 ロボットの操縦
ユーザー swdamdrswdamdr
提出日時 2017-01-24 11:29:11
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 820 bytes
コンパイル時間 925 ms
コンパイル使用メモリ 109,856 KB
実行使用メモリ 27,452 KB
最終ジャッジ日時 2024-12-23 07:51:45
合計ジャッジ時間 2,615 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        int ew = int.Parse(Console.ReadLine());

        if (ew < 0)
        {
            ew *= -1;
        }

        int ns = int.Parse(Console.ReadLine());
        int range = int.Parse(Console.ReadLine());
        int count = 0;

        if (ns != 0)
        {
            if (ns < 0)
            {
                count += 2;
            }

            count += ns / range;
            if (ns % range > 0)
            {
                count++;
            }
        }

        if (ew != 0)
        {
            count++;

            count += ew / range;
            if (ew % range > 0)
            {
                count++;
            }
        }

        Console.WriteLine(count);
        Console.ReadLine();
    }
}
0