結果
| 問題 | No.1049 Zero (Exhaust) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-08 21:46:46 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 2,000 ms |
| コード長 | 229 bytes |
| 記録 | |
| コンパイル時間 | 521 ms |
| コンパイル使用メモリ | 73,472 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-25 08:27:04 |
| 合計ジャッジ時間 | 1,328 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
const long mod=1e9+7;
long P;
int K;
main()
{
cin>>P>>K;
long t=1,a=0;
for(;K--;)
{
long nt=(t*(P+1)+a*2)%mod;
long na=(t*(P-1)+a*(2*P-2))%mod;
t=nt;
a=na;
}
cout<<t<<endl;
}