結果
問題 | No.1049 Zero (Exhaust) |
ユーザー |
![]() |
提出日時 | 2020-05-08 22:07:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 621 bytes |
コンパイル時間 | 727 ms |
コンパイル使用メモリ | 93,596 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-04 00:45:51 |
合計ジャッジ時間 | 1,535 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
// I SELL YOU...! #include<iostream> #include<vector> #include<algorithm> #include<functional> #include<queue> #include<chrono> #include<iomanip> #include<map> #include<set> using namespace std; using ll = long long; using P = pair<ll,ll>; using TP = tuple<ll,ll,ll>; void init_io(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(18); } #define MOD 1000000007 signed main(){ init_io(); ll p,k,tmp=1,z_way=1; cin >> p >> k; for(int i=0;i<k;i++){ z_way = z_way*(p+1) + 2*(tmp-z_way); z_way = (z_way+MOD)%MOD; tmp = tmp*(2*p); tmp %= MOD; } cout << z_way<<endl; }