結果
問題 | No.2275 →↑↓ |
ユーザー |
![]() |
提出日時 | 2023-04-21 21:43:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 84 ms / 2,000 ms |
コード長 | 690 bytes |
コンパイル時間 | 1,720 ms |
コンパイル使用メモリ | 168,952 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-06 15:12:19 |
合計ジャッジ時間 | 3,254 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h>using namespace std;const int INF = 1e9;using ll = long long;using inv = vector<int>;using stv = vector<string>;using pint = pair<int,int>;#define FOR(i,l,r) for(int i=(l); i<(r); i++)#define rep(i,r) for(int i=0; i<(r); i++)#define repl(i,r) for(long long i=0; i<(r); i++)#define FORl(i,l,r) for(long long i=(l); i<(r); i++)#define INFL ((1LL<<62)-(1LL<<31))#define pb(x) push_back(x)#define CIN(x) cin >> xconst ll MOD = 998244353LL;int main(){int N; cin >> N;vector<ll> A(N);rep(i,N) cin >> A[i];ll ans = 1LL;for(int i=N-1; i>= 1; i--){ans = (ans*min(A[i],A[i-1]))%MOD;}cout << ans%MOD << endl;}