結果

問題 No.796 well known
ユーザー betrue12betrue12
提出日時 2019-03-15 21:24:42
言語 Ruby
(3.3.0)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 157 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 11,564 KB
実行使用メモリ 16,188 KB
最終ジャッジ日時 2023-09-14 12:51:02
合計ジャッジ時間 3,207 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,356 KB
testcase_01 AC 82 ms
15,156 KB
testcase_02 AC 81 ms
15,056 KB
testcase_03 AC 81 ms
15,104 KB
testcase_04 AC 110 ms
16,036 KB
testcase_05 AC 114 ms
15,940 KB
testcase_06 AC 122 ms
16,032 KB
testcase_07 AC 91 ms
15,444 KB
testcase_08 AC 115 ms
15,896 KB
testcase_09 AC 104 ms
15,904 KB
testcase_10 AC 120 ms
16,188 KB
testcase_11 AC 90 ms
15,540 KB
testcase_12 AC 99 ms
15,700 KB
testcase_13 AC 112 ms
15,780 KB
testcase_14 AC 96 ms
15,516 KB
testcase_15 AC 100 ms
15,800 KB
testcase_16 AC 121 ms
16,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
ans = Array.new(N, 1)
ans[0] = 3
sum = ans.inject(:+)
pt = 1
while sum % 3 != 1
    ans[pt] = 3
    pt += 1
    sum += 2
end
puts ans.join(' ')
0