結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー むらためむらため
提出日時 2017-08-15 19:17:36
言語 Nim
(2.0.2)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 540 bytes
コンパイル時間 3,303 ms
コンパイル使用メモリ 69,036 KB
実行使用メモリ 22,036 KB
最終ジャッジ日時 2023-09-12 14:36:14
合計ジャッジ時間 4,449 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 28 ms
21,684 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 29 ms
21,572 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 8 ms
6,996 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 15 ms
11,808 KB
testcase_20 AC 28 ms
21,440 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 50) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated]
/home/judge/data/code/Main.nim(1, 50) Warning: imported and not used: 'future' [UnusedImport]
/home/judge/data/code/Main.nim(1, 26) Warning: imported and not used: 'strscans' [UnusedImport]

ソースコード

diff #

import sequtils,strutils,strscans,algorithm,math,future,macros
import sets,tables,hashes
template get*():string = stdin.readLine() #.strip()

let
  N = get().parseInt
  L = get().split().map(parseInt)
proc toCountedTable*[A](keys: openArray[A]): CountTable[A] =
  result = initCountTable[A](nextPowerOfTwo(keys.len * 3 div 2 + 4))
  for key in items(keys): result[key] = 1 + (if key in result : result[key] else: 0)

var ans :tuple[k,v:int]= (-1,0)
for k,v in L.toCountedTable().pairs:
  if ans.v <= v and ans.k < k: ans = (k,v)
echo ans.k
0