結果

問題 No.587 七対子
コンテスト
ユーザー toshiro_yanagi
提出日時 2018-06-15 18:52:48
言語 Nim
(2.2.10 + ac-library)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 297µs
コード長 240 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,991 ms
コンパイル使用メモリ 67,192 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-08-18 23:58:03
合計ジャッジ時間 4,835 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import tables
var S = initCountTable[char]()

for s in stdin.readLine:
  S.inc s

if S.largest.val == 2:
  let ss = S.smallest
  if ss.val == 1:
    S.inc ss.key
    if S.smallest.val == 2:
      echo ss.key
      quit()

echo "Impossible"
0