結果
問題 | No.1988 Divisor Tiling |
ユーザー |
|
提出日時 | 2022-06-24 23:21:32 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 641 bytes |
コンパイル時間 | 495 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,544 KB |
最終ジャッジ日時 | 2024-11-08 18:57:31 |
合計ジャッジ時間 | 11,133 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 32 |
コンパイルメッセージ
Main.rb:46: warning: ambiguous first argument; put parentheses or a space even after `-' operator Syntax OK
ソースコード
def lscan; gets.split.map(&:to_i); endn, h = lscandiv = (1..(n-1)).filter{|x| n/x*x == n}.to_adiv.each do |w|h2 = 0stk = 0ok = truediv.each do |x|if x/w*w != xstk += xif stk > wok = falsebreakendif stk == wh2 += 1stk = 0endnextendh2 += x/wendnext unless ok# p h2if h2 == hstk = []div.each do |x|if x/w*w != xstk += [x]*xif stk.size == wputs stk*' 'stk = []endnextend(x/w).times {puts [x]*w*' '}endendendp -1