結果
| 問題 |
No.1399 すごろくで世界旅行 (構築)
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 21:27:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 543 bytes |
| コンパイル時間 | 258 ms |
| コンパイル使用メモリ | 82,668 KB |
| 実行使用メモリ | 84,028 KB |
| 最終ジャッジ日時 | 2025-04-15 21:31:12 |
| 合計ジャッジ時間 | 24,113 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 WA * 13 |
ソースコード
V, D = map(int, input().split())
# Initialize adjacency matrix with all zeros
E = [[0] * V for _ in range(V)]
if V >= 3:
# Connect vertices 0, 1, 2 in a triangle
E[0][1] = E[1][0] = 1
E[1][2] = E[2][1] = 1
E[2][0] = E[0][2] = 1
# Connect remaining vertices to vertex 0
for i in range(3, V):
E[0][i] = E[i][0] = 1
elif V == 2:
# Connect the two vertices (though this may not satisfy all D, but handles V=2 cases)
E[0][1] = E[1][0] = 1
# Print the matrix
for row in E:
print(''.join(map(str, row)))
lam6er