結果
| 問題 | No.1181 Product Sum for All Subsets |
| コンテスト | |
| ユーザー |
PCTprobability
|
| 提出日時 | 2020-07-24 11:21:31 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 438 bytes |
| 記録 | |
| コンパイル時間 | 1,040 ms |
| コンパイル使用メモリ | 189,660 KB |
| 実行使用メモリ | 1,305,216 KB |
| 最終ジャッジ日時 | 2026-03-11 02:45:18 |
| 合計ジャッジ時間 | 3,459 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | MLE * 1 -- * 2 |
| other | -- * 27 |
ソースコード
#include <bits/stdc++.h>
#include <iostream>
#include <random>
using namespace std;
using ull = long long;
ull modpow(ull x, ull n, ull mod){
ull ret = 1;
while(n){
if(n & 1){
ret = modpow(ret, x, mod);
}
x = modpow(x, x, mod);
n >>= 1;
}
return ret;
}
int main(){
ull a,b;
cin>>b>>a;
ull mod=1000000007;
a=a%mod;
ull s=(a*(a+3)%mod);
ull k=(a*(a+1)%mod);
cout<<modpow(s,b,mod)%mod-modpow(k,b,mod)%mod<<endl;
}
PCTprobability