結果

問題 No.2275 →↑↓
ユーザー HIcoderHIcoder
提出日時 2023-07-12 07:12:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 557 bytes
コンパイル時間 914 ms
コンパイル使用メモリ 100,544 KB
実行使用メモリ 4,764 KB
最終ジャッジ日時 2023-10-11 21:13:52
合計ジャッジ時間 3,371 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 AC 63 ms
4,380 KB
testcase_07 AC 47 ms
4,348 KB
testcase_08 AC 77 ms
4,712 KB
testcase_09 AC 78 ms
4,712 KB
testcase_10 AC 79 ms
4,440 KB
testcase_11 AC 78 ms
4,580 KB
testcase_12 AC 78 ms
4,764 KB
testcase_13 AC 77 ms
4,432 KB
testcase_14 AC 79 ms
4,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<set>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<numeric>
#include<queue>
#include<cmath>
using namespace std;
typedef long long ll;
const ll INF=1LL<<60;
typedef pair<int,int> P;
typedef pair<int,P> PP;
const ll MOD=998244353;
const double PI=acos(-1);


int main(){
    int N;
    cin>>N;
    vector<ll> A(N);
    for(int i=0;i<N;i++){
        cin>>A[i];
    }
    ll ans=1;
    for(int i=0;i+1<N;i++){
        ans*=min(A[i],A[i+1]);
        ans%=MOD;
    }
    cout<<ans<<endl;
}
0