結果

問題 No.587 七対子
ユーザー bellangeldindon
提出日時 2019-05-20 13:24:18
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 527 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2024-07-19 19:59:15
合計ジャッジ時間 1,846 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

S = raw_input()
hand = []
for i in range(0, 13):
	hand.append(S[i])
hand.sort()
letter = []
lettercount = []
tmp = ''
for i in range(0, 13):
	if hand[i] == tmp: lettercount[-1] += 1
	else:
		letter.append(hand[i])
		lettercount.append(1)
		tmp = hand[i]
if len(letter) != 7: print 'Impossible'
else:
	notpair = ''
	for i in range(0, 7):
		if lettercount[i] > 2:
			print 'Impossible'
			break
		if lettercount[i] == 1:
			if notpair != '':
				print 'Impossible'
				break
			notpair = letter[i]
		if i == 6: print notpair
0