結果

問題 No.796 well known
ユーザー 👑 horiesinitihoriesiniti
提出日時 2023-01-18 16:22:32
言語 Ruby
(3.3.0)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 138 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 11,272 KB
実行使用メモリ 20,596 KB
最終ジャッジ日時 2023-09-02 10:39:46
合計ジャッジ時間 4,168 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,328 KB
testcase_01 AC 80 ms
15,240 KB
testcase_02 AC 81 ms
15,048 KB
testcase_03 AC 80 ms
15,120 KB
testcase_04 AC 103 ms
19,052 KB
testcase_05 AC 103 ms
19,192 KB
testcase_06 AC 114 ms
20,596 KB
testcase_07 AC 86 ms
16,264 KB
testcase_08 AC 102 ms
19,232 KB
testcase_09 AC 99 ms
17,644 KB
testcase_10 AC 117 ms
20,244 KB
testcase_11 AC 85 ms
15,384 KB
testcase_12 AC 95 ms
17,428 KB
testcase_13 AC 99 ms
18,992 KB
testcase_14 AC 92 ms
16,788 KB
testcase_15 AC 94 ms
17,416 KB
testcase_16 AC 114 ms
20,560 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

k=gets.to_i-1
ans=0
0.upto(k){|i|
	n=2*i+(k-i)+3
	if n%3==1 then
		ans=i
		break
	end
}
puts ("1"*(k-ans)+"2"*ans+"3").split("").join(" ")
0