結果

問題 No.1587 012 Matrix
ユーザー kona0001kona0001
提出日時 2021-07-08 22:35:35
言語 Ruby
(3.1.1p18 )
結果
AC  
実行時間 191 ms / 1,000 ms
コード長 222 bytes
コンパイル時間 33 ms
使用メモリ 16,396 KB
最終ジャッジ日時 2023-02-01 18:45:13
合計ジャッジ時間 4,602 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 72 ms
13,976 KB
testcase_01 AC 70 ms
13,796 KB
testcase_02 AC 70 ms
13,800 KB
testcase_03 AC 71 ms
13,716 KB
testcase_04 AC 71 ms
13,812 KB
testcase_05 AC 71 ms
13,920 KB
testcase_06 AC 72 ms
13,908 KB
testcase_07 AC 71 ms
13,724 KB
testcase_08 AC 71 ms
13,828 KB
testcase_09 AC 72 ms
13,804 KB
testcase_10 AC 77 ms
14,112 KB
testcase_11 AC 81 ms
14,476 KB
testcase_12 AC 90 ms
14,816 KB
testcase_13 AC 103 ms
15,168 KB
testcase_14 AC 119 ms
15,132 KB
testcase_15 AC 136 ms
15,364 KB
testcase_16 AC 155 ms
15,572 KB
testcase_17 AC 169 ms
16,100 KB
testcase_18 AC 180 ms
16,172 KB
testcase_19 AC 187 ms
16,156 KB
testcase_20 AC 190 ms
16,264 KB
testcase_21 AC 191 ms
16,396 KB
testcase_22 AC 72 ms
13,804 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
arr = Array.new(n){Array.new(n,0)}
n.times do |i|
  (i+1).times do |j|
    arr[i][j] += 1
  end
end
(n/2).times do |i|
  n.times do |j|
    arr[n-1-i][j] += 1
  end
end
arr.each do |ar|
  puts ar.join("")
end
0