結果
| 問題 | No.3786 Four Triplets, One Pair |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-11-06 21:21:46 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 47 ms / 2,000 ms |
| + 303µs | |
| コード長 | 1,494 bytes |
| 記録 | |
| コンパイル時間 | 81 ms |
| コンパイル使用メモリ | 64,348 KB |
| 実行使用メモリ | 59,856 KB |
| 最終ジャッジ日時 | 2026-11-06 21:21:50 |
| 合計ジャッジ時間 | 3,380 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
import sys
sys.setrecursionlimit(2*10**7)
#↓codon===============================
import string
Alp_low=list(string.ascii_lowercase)
Alp_up=list(string.ascii_uppercase)
Digit="0123456789"
dij=[[0,1],[1,0],[0,-1],[-1,0]]
def nin():
"""
library
https://github.com/not522/ac-library-python
https://github.com/cheran-senthil/PyRival
https://github.com/kurao2924/Kurao_Py_Library
https://github.com/navel-tos/cp-library-for-codon
"""
return list(map(int,input().split()))
def deq(x):
return [i-1 for i in x]
mod=998244353
_factorial=[1]
def factorial(n):
while len(_factorial)<=n:
_factorial.append((_factorial[-1]*len(_factorial))%mod)
return _factorial[n]
_inv_factorial=[1]
def inv_factorial(n):
while len(_inv_factorial)<=n:
_inv_factorial.append((_inv_factorial[-1]*pow(len(_inv_factorial),mod-2,mod))%mod)
return _inv_factorial[n]
def binom(n,r):
if r>=mod:
raise ValueError("r is too big")
if n<0:
return 0
if r>n:
return 0
if r<0:
return 0
ans=((factorial(n)*inv_factorial(r))%mod*inv_factorial(n-r))%mod
return ans
mod=998244353
def main():
a=nin()
ans=[]
for i in range(1,10):
b=a[:]+[i]
d={}
for j in b:
if j not in d:
d[j]=1
else:
d[j]+=1
if sorted(list(d.values()))==[2,3,3,3,3]:
ans.append(i)
print(len(ans))
print(*ans)
if __name__=="__main__":
main()