結果
| 問題 |
No.1399 すごろくで世界旅行 (構築)
|
| コンテスト | |
| ユーザー |
siman
|
| 提出日時 | 2022-06-17 01:02:18 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 297 bytes |
| コンパイル時間 | 582 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 25,088 KB |
| 最終ジャッジ日時 | 2024-10-07 11:21:27 |
| 合計ジャッジ時間 | 24,352 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 8 WA * 14 |
コンパイルメッセージ
Syntax OK
ソースコード
V, D = gets.split.map(&:to_i)
ans = Array.new(V) { Array.new(V, 0) }
V.times do |i|
ans[i][i] = 1
ans[i][(i + 1) % V] = 1
cur = i
d = D
(V - 1).times do |j|
cur = (cur + 1) % V
d -= 1
if d < 0
ans[i][cur] = 1
d = D - 1
end
end
end
puts ans.map(&:join)
siman