結果
問題 | No.254 文字列の構成 |
ユーザー |
|
提出日時 | 2017-05-16 23:37:09 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 91 ms / 5,000 ms |
コード長 | 570 bytes |
コンパイル時間 | 143 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-09-17 10:41:01 |
合計ジャッジ時間 | 4,529 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
コンパイルメッセージ
Syntax OK
ソースコード
def scan; gets.split.map(&:to_i); end# abababadef func(n)m = (n+2) / 2return (n.even? ? (m-2)*(m-1) : m*(m-1)-m+1) + nendn = gets.to_iputs "🍣" if n <= 0iwi = ['a','b']while n > 3# binary searchc = nill = 0; h = 100000while l < hc = (l+h+1)/2;if (n < func(c))h = c-1elsel = cendendk = ln -= func(l)print ((iwi[0]+iwi[1])*((k)/2))print iwi[0] if k.odd?iwi.map!(&:succ!).map!(&:succ!)endprint 'xyz'[0..(n-1)] if 0 < n