結果
| 問題 |
No.1682 Unfair Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-17 21:46:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 328 bytes |
| コンパイル時間 | 584 ms |
| コンパイル使用メモリ | 68,352 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-29 20:10:18 |
| 合計ジャッジ時間 | 1,270 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
コンパイルメッセージ
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 P[100];
main()
{
cin>>N;
mint L=1,R=0;
for(int i=0;i<N;i++)
{
cin>>P[i];
if(P[i]==50);
else if(P[i]<50)
{
L*=2;
R*=2;
}
else
{
L=R=L+R;
}
}
cout<<R.val()<<endl;
}