結果

問題 No.2275 →↑↓
ユーザー ineedyourlovepineedyourlovep
提出日時 2023-04-22 18:48:03
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 1,745 bytes
コンパイル時間 2,390 ms
コンパイル使用メモリ 197,536 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 21:39:51
合計ジャッジ時間 4,012 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 68 ms
5,376 KB
testcase_07 AC 52 ms
5,376 KB
testcase_08 AC 84 ms
5,376 KB
testcase_09 AC 83 ms
5,376 KB
testcase_10 AC 84 ms
5,376 KB
testcase_11 AC 83 ms
5,376 KB
testcase_12 AC 84 ms
5,376 KB
testcase_13 AC 85 ms
5,376 KB
testcase_14 AC 85 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
//const int mod = 1000000007;
const int mod = 998244353;

//MINT
struct mint {
  unsigned x;
  mint(): x(0) {}
  mint(ll x):x((x%mod+mod)%mod) {}
  mint operator-() const { return mint(0) - *this;}
  mint operator~() const { return mint(1) / *this;}
  mint& operator+=(const mint& a) { if((x+=a.x)>=mod) x-=mod; return *this;}
  mint& operator-=(const mint& a) { if((x+=mod-a.x)>=mod) x-=mod; return *this;}
  mint& operator*=(const mint& a) { x=(unsigned long long)x*a.x%mod; return *this;}
  mint& operator/=(const mint& a) { x=(unsigned long long)x*a.pow(mod-2).x%mod; return *this;}
  mint operator+(const mint& a) const { return mint(*this) += a;}
  mint operator-(const mint& a) const { return mint(*this) -= a;}
  mint operator*(const mint& a) const { return mint(*this) *= a;}
  mint operator/(const mint& a) const { return mint(*this) /= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint res = pow(t>>1);
    res *= res;
    return (t&1)?res*x:res;
  }
  bool operator<(const mint& a) const { return x < a.x;}
  bool operator==(const mint& a) const { return x == a.x;}
  bool operator!=(const mint& a) const { return x != a.x;}
};
mint ex(mint x, ll t) { return x.pow(t);}
istream& operator>>(istream& i, mint& a) { unsigned long long t; i>>t; a=mint(t); return i;}
ostream& operator<<(ostream& o, const mint& a) { return o<<a.x;}

int main()
{
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i, 0, n) cin >> a[i];
  mint ans = 1;
  rep(i, 1, n) {
    ans *= min(a[i-1], a[i]);
  }
  cout << ans << endl;
  return 0;
}
0