結果

問題 No.48 ロボットの操縦
ユーザー mencottonmencotton
提出日時 2017-12-25 16:09:33
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 623 bytes
コンパイル時間 1,035 ms
コンパイル使用メモリ 102,272 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2024-05-10 00:55:07
合計ジャッジ時間 2,370 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 22 ms
17,920 KB
testcase_05 WA -
testcase_06 AC 22 ms
17,792 KB
testcase_07 AC 22 ms
17,792 KB
testcase_08 WA -
testcase_09 AC 22 ms
17,536 KB
testcase_10 WA -
testcase_11 AC 21 ms
17,664 KB
testcase_12 AC 22 ms
17,920 KB
testcase_13 AC 23 ms
17,920 KB
testcase_14 AC 21 ms
17,792 KB
testcase_15 AC 22 ms
17,536 KB
testcase_16 AC 21 ms
17,792 KB
testcase_17 AC 22 ms
18,048 KB
testcase_18 WA -
testcase_19 AC 22 ms
17,664 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace template
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int ret = (Math.Abs(x) - 1) / n == 0 ? (Math.Abs(x) - 1) / n : (Math.Abs(x) - 1) / n + 1;
            ret += (Math.Abs(y) - 1) / n == 0 ? (Math.Abs(y) - 1) / n + 1 : (Math.Abs(y) - 1) / n + 2;
            Console.WriteLine(ret);
        }
    }
}
0