結果

問題 No.688 E869120 and Constructing Array 2
ユーザー 👑 tatt61880tatt61880
提出日時 2021-03-20 22:35:52
言語 Kuin
(KuinC++ v.2021.9.17)
結果
WA  
実行時間 -
コード長 561 bytes
コンパイル時間 2,280 ms
コンパイル使用メモリ 151,664 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-14 17:46:28
合計ジャッジ時間 3,461 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var k: int :: cui@inputInt()
	if(k = 0)
		do cui@print("0\n")
		ret
	end if
	for i(2, 30)
		var a: int :: i * (i - 1) / 2
		if(k % a = 0)
			var rest: int :: k / a
			var cnt: int :: 0
			while(rest % 2 = 0)
				do rest :/ 2
				do cnt :+ 1
			end while
			if(rest = 1 & cnt + i <= 30)
				var n: int :: cnt + i
				var b: []int :: #[n]int
				for j(0, i - 1)
					do b[j] :: 1
				end for
				do cui@print("\{n}\n")
				for j(0, n - 1)
					do cui@print("\{b[j]}\{j = n - 1 ?("\n", " ")}")
				end for
				ret
			end if
		end if
	end for
end func
0