結果

問題 No.3786 Four Triplets, One Pair
コンテスト
ユーザー hiro1729
提出日時 2026-11-06 17:49:52
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 33 ms / 2,000 ms
+ 811µs
コード長 325 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 96 ms
コンパイル使用メモリ 64,764 KB
実行使用メモリ 53,596 KB
最終ジャッジ日時 2026-11-06 21:13:25
合計ジャッジ時間 3,233 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

A = list(map(int, input().split()))
cnt = [0] * 10
for i in A: cnt[i] += 1
cnt_d = [[] for _ in range(4)]
for i in range(1, 10):
	if cnt[i] <= 3:
		cnt_d[cnt[i]].append(i)
if len(cnt_d[3]) == 4:
	print(1)
	print(cnt_d[1][0])
elif len(cnt_d[3]) == 3 and len(cnt_d[2]) == 2:
	print(2)
	print(*cnt_d[2])
else:
	print(0)
	print()
0