結果
問題 | No.587 七対子 |
ユーザー |
![]() |
提出日時 | 2019-02-27 10:06:45 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 448 bytes |
コンパイル時間 | 13,735 ms |
コンパイル使用メモリ | 223,728 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 19:58:48 |
合計ジャッジ時間 | 11,765 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
package main import "fmt" func main() { s := "" _, _ = fmt.Scan(&s) sets := make(map[string]int, 0) for _, c := range s { if _, ok := sets[string(c)]; ok { sets[string(c)]++ if sets[string(c)] > 2 { fmt.Println("Impossible") return } } else { sets[string(c)] = 1 } } if len(sets) != 7 { fmt.Println("Impossible") return } c := "" for k, v := range sets { if v == 1 { c = k } } fmt.Println(c) }