結果

問題 No.1253 雀見椪
ユーザー tatt61880
提出日時 2021-02-15 20:12:56
言語 Kuin
(KuinC++ v.2021.9.17)
結果
RE  
実行時間 -
コード長 914 bytes
コンパイル時間 2,210 ms
コンパイル使用メモリ 147,148 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-16 11:24:16
合計ジャッジ時間 4,896 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2 RE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var t: int :: cui@inputInt()
	for(1, t)
		var n: int :: cui@inputInt()
		var g: int :: cui@inputInt()
		var G: int :: cui@inputInt()
		var c: int :: cui@inputInt()
		var C: int :: cui@inputInt()
		var p: int :: cui@inputInt()
		var P: int :: cui@inputInt()
		var mod: int :: 1000000007
		
		var ans: int :: 0
		do ans :+ math@modPow(G * C * P, n, mod)
		do ans :% mod
		do ans :+ math@modPow(g * C * P, n, mod) * 2
		do ans :% mod
		do ans :+ math@modPow(G * c * P, n, mod) * 2
		do ans :% mod
		do ans :+ math@modPow(G * C * p, n, mod) * 2
		do ans :% mod
		do ans :+ mod - math@modPow((G - g) * C * P, n, mod)
		do ans :% mod
		do ans :+ mod - math@modPow(G * (C - c) * P, n, mod)
		do ans :% mod
		do ans :+ mod - math@modPow(G * C * (P - p), n, mod)
		do ans :% mod
		do ans :* math@modPow(math@modPow(G * C * P, n, mod), mod - 2, mod)
		do ans :% mod
		do cui@print("\{ans}\n")
	end for
end func
0