結果

問題 No.112 ややこしい鶴亀算
ユーザー bluemeganebluemegane
提出日時 2018-09-21 19:34:36
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 5,000 ms
コード長 469 bytes
コンパイル時間 2,107 ms
コンパイル使用メモリ 100,480 KB
実行使用メモリ 23,736 KB
最終ジャッジ日時 2023-09-25 10:47:43
合計ジャッジ時間 4,849 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
23,540 KB
testcase_01 AC 59 ms
21,592 KB
testcase_02 AC 60 ms
21,536 KB
testcase_03 AC 61 ms
23,640 KB
testcase_04 AC 61 ms
21,660 KB
testcase_05 AC 60 ms
21,480 KB
testcase_06 AC 60 ms
21,528 KB
testcase_07 AC 61 ms
21,540 KB
testcase_08 AC 61 ms
23,596 KB
testcase_09 AC 61 ms
21,524 KB
testcase_10 AC 61 ms
23,736 KB
testcase_11 AC 61 ms
21,524 KB
testcase_12 AC 61 ms
19,476 KB
testcase_13 AC 61 ms
21,552 KB
testcase_14 AC 60 ms
23,700 KB
testcase_15 AC 61 ms
21,600 KB
testcase_16 AC 61 ms
23,600 KB
testcase_17 AC 61 ms
23,528 KB
testcase_18 AC 61 ms
21,556 KB
testcase_19 AC 60 ms
21,452 KB
testcase_20 AC 62 ms
21,456 KB
testcase_21 AC 61 ms
23,728 KB
testcase_22 AC 61 ms
23,576 KB
testcase_23 AC 61 ms
21,528 KB
testcase_24 AC 64 ms
21,484 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Linq;
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        var s = a.Sum() / (n - 1);
        var t = 0; var k = 0;
        for (int i = 0; i < n; i++)
            if (s - a[i] == 2) t++;
            else k++;
        Console.WriteLine("{0} {1}", t, k);
    }
}
0