結果

問題 No.410 出会い
ユーザー noriocnorioc
提出日時 2016-08-12 22:32:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 741 bytes
コンパイル時間 2,046 ms
コンパイル使用メモリ 103,440 KB
実行使用メモリ 27,940 KB
最終ジャッジ日時 2023-09-10 19:51:51
合計ジャッジ時間 4,576 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
25,884 KB
testcase_01 AC 65 ms
25,864 KB
testcase_02 AC 65 ms
25,868 KB
testcase_03 AC 68 ms
25,800 KB
testcase_04 AC 65 ms
23,852 KB
testcase_05 AC 64 ms
23,880 KB
testcase_06 AC 65 ms
25,756 KB
testcase_07 AC 66 ms
25,720 KB
testcase_08 AC 65 ms
23,832 KB
testcase_09 AC 65 ms
25,912 KB
testcase_10 AC 65 ms
23,968 KB
testcase_11 AC 66 ms
25,896 KB
testcase_12 AC 64 ms
23,872 KB
testcase_13 AC 65 ms
23,980 KB
testcase_14 AC 65 ms
27,940 KB
testcase_15 AC 64 ms
23,904 KB
testcase_16 AC 65 ms
24,004 KB
testcase_17 AC 67 ms
23,872 KB
testcase_18 AC 64 ms
21,848 KB
testcase_19 AC 64 ms
23,916 KB
testcase_20 AC 64 ms
23,928 KB
testcase_21 AC 65 ms
25,968 KB
testcase_22 AC 64 ms
23,844 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class Program {
    static string ReadLine() { return Console.ReadLine(); }
    static int ReadInt() { return int.Parse(ReadLine()); }
    static int[] ReadInts() { return ReadLine().Split().Select(int.Parse).ToArray(); }
    static string[] ReadStrings() { return ReadLine().Split(); }

    static void Main() {
        var p = ReadInts();
        var q = ReadInts();

        var dx = Math.Abs(p[0] - q[0]);
        var dy = Math.Abs(p[1] - q[1]);

        double ans = dx/2 + dy/2;
        int n = (dx % 2) + (dy % 2);
        if (n == 2) {
            ans++;
        }
        else if (n == 1) {
            ans += 0.5;
        }
        Console.WriteLine(ans);
    }
}
0