結果

問題 No.706 多眼生物の調査
ユーザー mkanenobumkanenobu
提出日時 2018-09-20 14:58:36
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 3,148 ms
コンパイル使用メモリ 71,580 KB
実行使用メモリ 4,952 KB
最終ジャッジ日時 2023-09-13 20:11:35
合計ジャッジ時間 3,813 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 39) Warning: imported and not used: 'math' [UnusedImport]

ソースコード

diff #

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