結果

問題 No.706 多眼生物の調査
コンテスト
ユーザー mkanenobu
提出日時 2018-09-20 14:58:36
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 496 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,501 ms
コンパイル使用メモリ 72,044 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-21 23:06:19
合計ジャッジ時間 3,039 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sequtils, strutils, algorithm, math

var
  n = readLine(stdin).parseInt
  s:seq[string] = mapIt(0..<n, readLine(stdin))
  maxEyes = 0
  cntEyes = 0
  numOfEyes:seq[int] = mapIt(0..<1000, 0)

for i in s:
  cntEyes = i.count('^')
  numOfEyes[cntEyes] += 1
  if cntEyes > maxEyes:
    maxEyes = cntEyes

numOfEyes = numOfEyes[1..(maxEyes)]
if count(numOfEyes, max(numOfEyes)) > 1:
  numOfEyes.reverse
  echo find(numOfEyes, max(numOfEyes)) + 1
else:
  echo find(numOfEyes, max(numOfEyes)) + 1
0