結果

問題 No.1237 EXP Multiple!
ユーザー 👑 tatt61880tatt61880
提出日時 2021-02-25 17:39:14
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 2,056 ms
コンパイル使用メモリ 149,604 KB
実行使用メモリ 5,188 KB
最終ジャッジ日時 2023-10-14 17:26:31
合計ジャッジ時間 5,890 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 72 ms
4,808 KB
testcase_02 AC 97 ms
4,836 KB
testcase_03 AC 99 ms
5,072 KB
testcase_04 AC 104 ms
4,892 KB
testcase_05 AC 56 ms
4,896 KB
testcase_06 AC 57 ms
5,124 KB
testcase_07 AC 58 ms
4,964 KB
testcase_08 AC 56 ms
5,088 KB
testcase_09 AC 56 ms
5,092 KB
testcase_10 AC 57 ms
5,188 KB
testcase_11 AC 55 ms
5,068 KB
testcase_12 AC 56 ms
5,072 KB
testcase_13 AC 56 ms
4,924 KB
testcase_14 AC 56 ms
5,100 KB
testcase_15 AC 56 ms
5,068 KB
testcase_16 AC 56 ms
4,988 KB
testcase_17 AC 57 ms
5,020 KB
testcase_18 AC 56 ms
5,084 KB
testcase_19 AC 55 ms
4,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var a: []int :: #[n]int
	for i(0, n - 1)
		do a[i] :: cui@inputInt()
	end for
	if(a.min() = 0)
		do cui@print("-1\n")
		ret
	end if
	
	const c: int :: 1000000007
	if(a.max() > 3)
		do cui@print("\{c}\n")
		ret
	end if
	
	var val: []int :: [0, 1, 2 ^ 2, 3 ^ 6]
	var ans: int :: 1
	for i(0, n - 1)
		do ans :* val[a[i]]
		if(ans > c)
			break i
		end if
	end for
	do cui@print("\{c % ans}\n")
end func
0