結果
問題 | No.6 使いものにならないハッシュ |
ユーザー |
![]() |
提出日時 | 2024-03-12 14:55:32 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 137 ms / 5,000 ms |
コード長 | 389 bytes |
コンパイル時間 | 286 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 80,684 KB |
最終ジャッジ日時 | 2024-09-29 22:19:44 |
合計ジャッジ時間 | 4,729 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 32 |
ソースコード
k=int(input())n=int(input())p=[1]*-~np[0]=p[1]=0h=[None]*-~nh[:10]=*range(10),for i in range(n+1):if p[i]:for j in range(i*i,n+1,i):p[j]=0h[i]=h[sum(map(int,str(i)))]h=[(h[i],i)for i in range(k,n+1)if p[i]]+[[0,0]]s={0}m=len(h)-1p=0r=(0,0)for i in range(m):while h[p][0] not in s:s|={h[p][0]};p+=1r=max(r,(p-i,h[i][1]))s^={h[i][0]}print(r[1])