結果
問題 | No.1253 雀見椪 |
ユーザー | 👑 tatt61880 |
提出日時 | 2021-02-15 23:11:45 |
言語 | Kuin (KuinC++ v.2021.9.17) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,613 bytes |
コンパイル時間 | 4,252 ms |
コンパイル使用メモリ | 184,016 KB |
実行使用メモリ | 8,092 KB |
最終ジャッジ日時 | 2023-10-14 17:10:10 |
合計ジャッジ時間 | 7,166 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,368 KB |
testcase_01 | AC | 2 ms
4,352 KB |
testcase_02 | AC | 13 ms
4,352 KB |
testcase_03 | AC | 208 ms
4,352 KB |
testcase_04 | TLE | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
ソースコード
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() const mod: int :: 1000000007 var ans: modInt :: (#modInt).init(0, mod) do ans.add((#modInt).init(G, mod).mul(C).mul(P).pow(n).val) do ans.add((#modInt).init(g, mod).mul(C).mul(P).pow(n).val * 2) do ans.add((#modInt).init(G, mod).mul(c).mul(P).pow(n).val * 2) do ans.add((#modInt).init(G, mod).mul(C).mul(p).pow(n).val * 2) do ans.sub((#modInt).init(G - g, mod).mul(C).mul(P).pow(n).val) do ans.sub((#modInt).init(G, mod).mul(C - c).mul(P).pow(n).val) do ans.sub((#modInt).init(G, mod).mul(C).mul(P - p).pow(n).val) do ans.div((#modInt).init(G, mod).mul(C).mul(P).pow(n).val) do cui@print("\{ans}\n") end for class modInt() +var val: int var mod: int +func init(val: int, mod: int): modInt do me.val :: val do me.mod :: mod ret me end func +func add(a: int): modInt do me.val :: (me.val + a) % me.mod ret me end func +func sub(a: int): modInt do me.val :: (me.val + me.mod - a) % me.mod ret me end func +func mul(a: int): modInt do me.val :: (me.val * a) % me.mod ret me end func +func div(a: int): modInt do me.val :: me.val * math@modPow(a, me.mod - 2, me.mod) % me.mod ret me end func +func pow(a: int): modInt do me.val :: math@modPow(me.val, a, me.mod) ret me end func +*func toStr(): []char ret "\{me.val}" end func end class end func