結果
問題 |
No.79 過小評価ダメ・ゼッタイ
|
ユーザー |
|
提出日時 | 2017-08-15 19:07:55 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 21 ms / 5,000 ms |
コード長 | 543 bytes |
コンパイル時間 | 3,761 ms |
コンパイル使用メモリ | 76,448 KB |
実行使用メモリ | 16,768 KB |
最終ジャッジ日時 | 2024-06-30 02:40:12 |
合計ジャッジ時間 | 4,787 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
コンパイルメッセージ
/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, 26) Warning: imported and not used: 'strscans' [UnusedImport]
ソースコード
import sequtils,strutils,strscans,algorithm,math,future,macros import sets,tables,hashes template get*():string = stdin.readLine() #.strip() 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) let N = get().parseInt L = get().split().map(parseInt) echo toSeq(L.toCountedTable().pairs) .sorted((x,y) => (if x[1] != y[1] : x[1] - y[1] else: x[0] - y[0]),Descending)[0][0]