結果

問題 No.112 ややこしい鶴亀算
ユーザー NoNo
提出日時 2018-01-31 04:38:31
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 5,000 ms
コード長 493 bytes
コンパイル時間 3,304 ms
コンパイル使用メモリ 104,104 KB
実行使用メモリ 23,992 KB
最終ジャッジ日時 2023-08-28 17:04:29
合計ジャッジ時間 5,177 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,872 KB
testcase_01 AC 61 ms
23,988 KB
testcase_02 AC 61 ms
21,864 KB
testcase_03 AC 61 ms
21,892 KB
testcase_04 AC 59 ms
21,980 KB
testcase_05 AC 61 ms
21,960 KB
testcase_06 AC 61 ms
19,876 KB
testcase_07 AC 61 ms
23,788 KB
testcase_08 AC 60 ms
23,876 KB
testcase_09 AC 60 ms
21,844 KB
testcase_10 AC 61 ms
19,944 KB
testcase_11 AC 61 ms
21,900 KB
testcase_12 AC 61 ms
22,008 KB
testcase_13 AC 61 ms
23,880 KB
testcase_14 AC 61 ms
23,876 KB
testcase_15 AC 61 ms
23,992 KB
testcase_16 AC 61 ms
20,060 KB
testcase_17 AC 62 ms
22,000 KB
testcase_18 AC 62 ms
21,800 KB
testcase_19 AC 61 ms
21,872 KB
testcase_20 AC 61 ms
23,880 KB
testcase_21 AC 62 ms
21,920 KB
testcase_22 AC 61 ms
22,128 KB
testcase_23 AC 63 ms
23,940 KB
testcase_24 AC 61 ms
21,900 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;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            Array.Sort(a);
            var t = 0;
            if (a[0] == a[n - 1]) t = a[0] == (n - 1) * 2 ? n : 0;
            else t = a.Count(x => x == a[n - 1]);
            Console.WriteLine("{0} {1}", t, n - t);
        }
    }
}
0