結果

問題 No.112 ややこしい鶴亀算
ユーザー しらゆきしらゆき
提出日時 2015-11-20 11:00:05
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 2,141 ms
コンパイル使用メモリ 102,488 KB
実行使用メモリ 23,852 KB
最終ジャッジ日時 2023-10-11 18:08:36
合計ジャッジ時間 5,049 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
21,792 KB
testcase_01 WA -
testcase_02 AC 64 ms
21,952 KB
testcase_03 AC 64 ms
21,968 KB
testcase_04 WA -
testcase_05 AC 63 ms
21,864 KB
testcase_06 AC 64 ms
23,852 KB
testcase_07 AC 63 ms
21,956 KB
testcase_08 AC 65 ms
23,836 KB
testcase_09 WA -
testcase_10 AC 64 ms
21,952 KB
testcase_11 AC 64 ms
21,964 KB
testcase_12 AC 64 ms
21,976 KB
testcase_13 AC 65 ms
21,964 KB
testcase_14 WA -
testcase_15 AC 64 ms
21,848 KB
testcase_16 AC 64 ms
21,840 KB
testcase_17 AC 65 ms
21,800 KB
testcase_18 AC 64 ms
21,892 KB
testcase_19 AC 65 ms
21,832 KB
testcase_20 WA -
testcase_21 AC 64 ms
21,804 KB
testcase_22 AC 64 ms
21,804 KB
testcase_23 AC 63 ms
21,920 KB
testcase_24 AC 64 ms
21,872 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.Linq;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();

        int crane = 0;

        for (int i = 0; i < n; i++)
        {
            if (a[i] - a.Min() == 2) crane++;
        }

        if (a.Sum() == 2 * n * (n - 1)) crane = 0;

        Console.WriteLine("{0} {1}", crane, n - crane);
    }
}
0