結果

問題 No.2673 A present from B
ユーザー sasa8uyauyasasa8uyauya
提出日時 2024-03-15 22:51:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 84,300 KB
最終ジャッジ日時 2024-03-15 22:51:56
合計ジャッジ時間 5,655 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n,m=map(int,input().split())
a=[i%n for i in range(m)]
p=list(range(n))
e=[[n]*n for i in range(n)]
for i in range(n):
	for j in range(n):
		e[p[i]][p[j]]=min(e[p[i]][p[j]],abs(i-j))
for y in range(m):
	p[y-1],p[y]=p[y],p[y-1]
	for i in range(n):
		for j in range(n):
			e[p[i]][p[j]]=min(e[p[i]][p[j]],abs(i-j))
for k in range(n):
	for i in range(n):
		for j in range(n):
			e[i][j]=min(e[i][j],e[i][k]+e[k][j])
print(*[e[i][p[0]] for i in range(1,n)])
0