結果

問題 No.2463 ストレートフラッシュ
ユーザー sasa8uyauyasasa8uyauya
提出日時 2023-09-09 00:10:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 337 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 79,940 KB
最終ジャッジ日時 2023-09-09 00:10:17
合計ジャッジ時間 6,889 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 81 ms
76,648 KB
testcase_04 AC 87 ms
76,776 KB
testcase_05 AC 87 ms
76,836 KB
testcase_06 AC 72 ms
71,600 KB
testcase_07 AC 82 ms
76,728 KB
testcase_08 AC 86 ms
76,908 KB
testcase_09 AC 98 ms
77,052 KB
testcase_10 AC 82 ms
76,732 KB
testcase_11 AC 72 ms
71,596 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 267 ms
79,212 KB
testcase_15 AC 248 ms
79,348 KB
testcase_16 AC 260 ms
79,196 KB
testcase_17 AC 293 ms
79,280 KB
testcase_18 AC 314 ms
79,660 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 261 ms
79,728 KB
testcase_22 WA -
testcase_23 AC 286 ms
79,632 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
c=[[0]*(n+1) for i in range(m)]
for i in range(n*m):
	s,t=map(int,input().split())
	s-=1
	t-=1
	c[t][s]=max(0,i-4)
	if s==0:
		c[t][n]=max(0,i-4)
a=n*m
for i in range(m):
	for j in range(n-3):
		g=[-1]+c[i][j:j+5]
		g.sort()
		b=0
		for k in range(5):
			b+=(g[k+1]-g[k]-1+5-k-1)//(5-k)
		a=min(a,b)
print(a)
0