結果
問題 | No.706 多眼生物の調査 |
ユーザー |
![]() |
提出日時 | 2018-09-06 10:22:45 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 67 ms / 2,000 ms |
コード長 | 587 bytes |
コンパイル時間 | 1,971 ms |
コンパイル使用メモリ | 114,016 KB |
実行使用メモリ | 27,300 KB |
最終ジャッジ日時 | 2024-11-21 12:03:33 |
合計ジャッジ時間 | 3,097 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System.Collections.Generic;using System.Linq;using System;public class Hello{public static void Main(){var d = new Dictionary<int, int>();var n = int.Parse(Console.ReadLine().Trim());for (int i = 0; i < n; i++){var s = Console.ReadLine().Trim();var a = s.Length - s.Replace("^", "").Length;if (d.ContainsKey(a)) d[a]++;else d[a] = 1;}var ans = d.OrderByDescending(x => x.Value).ThenByDescending(x => x.Key).First();Console.WriteLine(ans.Key);}}