結果
問題 |
No.2463 ストレートフラッシュ
|
ユーザー |
![]() |
提出日時 | 2023-09-08 22:06:08 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 443 bytes |
コンパイル時間 | 415 ms |
コンパイル使用メモリ | 82,092 KB |
実行使用メモリ | 103,116 KB |
最終ジャッジ日時 | 2024-06-26 15:08:59 |
合計ジャッジ時間 | 27,835 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | WA * 14 TLE * 8 |
ソースコード
N,M = map(int, input().split()) NM = [list(map(int, input().split())) for _ in range(N*M)] ans = 10**10 for i in range(1,M+1): cnt = 0 hand = 0 card = 5 for n,m in NM[:5]: if m==i and (n==1 or n>=N-3): hand+=1 while hand<5: for n,m in NM[card:card+5-hand]: if m==i and (n==1 or n>=N-3): hand+=1 card+=1 cnt+=1 ans = min(cnt,ans) print(ans)