結果
| 問題 | No.587 七対子 | 
| コンテスト | |
| ユーザー | 👑 | 
| 提出日時 | 2019-03-29 01:13:16 | 
| 言語 | Lua (LuaJit 2.1.1734355927) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 357 bytes | 
| コンパイル時間 | 156 ms | 
| コンパイル使用メモリ | 5,120 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-19 19:58:29 | 
| 合計ジャッジ時間 | 1,004 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 35 | 
ソースコード
s = io.read()
t = {}
for i = 1, 13 do
    a = string.sub(s, i, i)
    if(t[a] == nil) then t[a] = 1 else t[a] = t[a] + 1 end
end
tgt = nil
imp = false
for k, v in pairs(t) do
    if(v == 1) then
        if(tgt == nil) then tgt = k else imp = true end
    elseif(2 < v) then
        imp = true
    end
end
if(imp) then print("Impossible") else print(tgt) end
            
            
            
        