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