結果

問題 No.2463 ストレートフラッシュ
ユーザー 👑 H20H20
提出日時 2023-09-08 22:06:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 801 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 104,092 KB
最終ジャッジ日時 2023-09-08 22:06:42
合計ジャッジ時間 29,936 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,436 KB
testcase_01 AC 70 ms
71,288 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)



0