結果
| 問題 | No.1681 +-* |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-17 21:37:54 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 53 ms / 2,000 ms |
| コード長 | 292 bytes |
| 記録 | |
| コンパイル時間 | 436 ms |
| コンパイル使用メモリ | 79,808 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-19 10:09:55 |
| 合計ジャッジ時間 | 1,727 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
8 | main()
| ^~~~
ソースコード
#include<iostream>
#include<algorithm>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint1000000007;
int N;
int A[2<<17];
main()
{
cin>>N;
for(int i=0;i<N;i++)cin>>A[i];
mint X=0,Y=A[0];
for(int i=1;i<N;i++)
{
X=X*3+2*Y;
Y*=A[i];
}
cout<<(X+Y).val()<<endl;
}