結果
問題 | No.112 ややこしい鶴亀算 |
ユーザー |
![]() |
提出日時 | 2018-01-31 04:38:31 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 35 ms / 5,000 ms |
コード長 | 493 bytes |
コンパイル時間 | 1,134 ms |
コンパイル使用メモリ | 111,964 KB |
実行使用メモリ | 19,456 KB |
最終ジャッジ日時 | 2024-12-29 22:46:12 |
合計ジャッジ時間 | 3,234 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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); } } }