結果

問題 No.112 ややこしい鶴亀算
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-09-08 16:01:41
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 552 bytes
コンパイル時間 693 ms
コンパイル使用メモリ 113,276 KB
実行使用メモリ 27,336 KB
最終ジャッジ日時 2024-04-27 17:58:12
合計ジャッジ時間 2,020 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
25,132 KB
testcase_01 AC 25 ms
25,172 KB
testcase_02 AC 25 ms
25,384 KB
testcase_03 AC 26 ms
25,392 KB
testcase_04 AC 26 ms
25,300 KB
testcase_05 AC 25 ms
27,328 KB
testcase_06 AC 26 ms
25,420 KB
testcase_07 AC 25 ms
25,416 KB
testcase_08 AC 25 ms
25,264 KB
testcase_09 AC 24 ms
23,472 KB
testcase_10 AC 26 ms
27,312 KB
testcase_11 AC 25 ms
25,300 KB
testcase_12 AC 24 ms
23,220 KB
testcase_13 AC 25 ms
25,160 KB
testcase_14 AC 25 ms
25,420 KB
testcase_15 AC 26 ms
24,908 KB
testcase_16 AC 25 ms
25,424 KB
testcase_17 AC 27 ms
25,424 KB
testcase_18 AC 26 ms
25,428 KB
testcase_19 AC 25 ms
25,172 KB
testcase_20 AC 25 ms
25,168 KB
testcase_21 AC 27 ms
25,296 KB
testcase_22 AC 26 ms
25,396 KB
testcase_23 AC 27 ms
27,336 KB
testcase_24 AC 25 ms
25,292 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;

public class Program
{
	public static void Main()
	{
		int N = int.Parse(Console.ReadLine());
		var a = Console.ReadLine().Split().Select(i => int.Parse(i));
		if (a.Distinct().Count() == 1)
		{
			if (a.First() / (N - 1) == 2)
			{
				Console.WriteLine("{0} 0", N);
			}
			else
			{
				Console.WriteLine("0 {0}", N);
			}
		}
		else
		{
			var crane = a.Count(i => i == a.Max());
			var turtle = a.Count(i => i == a.Min());
			Console.WriteLine("{0} {1}", crane, turtle);
		}
	}
}
0