結果

問題 No.1587 012 Matrix
ユーザー kona0001kona0001
提出日時 2021-07-08 22:35:35
言語 Ruby
(3.3.0)
結果
AC  
実行時間 178 ms / 1,000 ms
コード長 222 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 11,380 KB
実行使用メモリ 17,372 KB
最終ジャッジ日時 2023-09-14 05:12:00
合計ジャッジ時間 4,146 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
15,116 KB
testcase_01 AC 68 ms
15,328 KB
testcase_02 AC 69 ms
15,152 KB
testcase_03 AC 69 ms
15,088 KB
testcase_04 AC 70 ms
15,108 KB
testcase_05 AC 69 ms
15,084 KB
testcase_06 AC 69 ms
15,196 KB
testcase_07 AC 72 ms
15,128 KB
testcase_08 AC 73 ms
15,168 KB
testcase_09 AC 74 ms
15,264 KB
testcase_10 AC 72 ms
15,152 KB
testcase_11 AC 78 ms
15,436 KB
testcase_12 AC 88 ms
15,604 KB
testcase_13 AC 98 ms
16,164 KB
testcase_14 AC 106 ms
15,984 KB
testcase_15 AC 120 ms
16,548 KB
testcase_16 AC 141 ms
16,532 KB
testcase_17 AC 151 ms
16,796 KB
testcase_18 AC 158 ms
17,064 KB
testcase_19 AC 170 ms
17,176 KB
testcase_20 AC 169 ms
17,152 KB
testcase_21 AC 178 ms
17,372 KB
testcase_22 AC 72 ms
15,084 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