結果
問題 |
No.706 多眼生物の調査
|
ユーザー |
![]() |
提出日時 | 2018-12-09 04:39:47 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 471 bytes |
コンパイル時間 | 776 ms |
コンパイル使用メモリ | 96,888 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-13 02:08:12 |
合計ジャッジ時間 | 1,457 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
import std.stdio; import std.array; import std.string; import std.conv; import std.math; void main() { int n = to!int(chomp(readln())); int[ulong] counter; foreach (i; 0..n) { counter[chomp(readln()).length - 2]++; } int ans = -1; foreach (k; counter.keys()) { if (ans < 0 || counter[k] > counter[ans] || (counter[k] == counter[ans] && k > ans)) { ans = to!int(k); } } writeln(ans); }