結果
| 問題 |
No.2950 Max Min Product
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-01 23:02:31 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 481 bytes |
| コンパイル時間 | 12,986 ms |
| コンパイル使用メモリ | 307,680 KB |
| 実行使用メモリ | 13,764 KB |
| 最終ジャッジ日時 | 2024-09-23 14:15:19 |
| 合計ジャッジ時間 | 21,554 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 35 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using mint=atcoder::modint998244353;
int main(){
int n;cin>>n;
vector<int> a(n);for(auto&e:a)cin>>e;
mint ans=0;
for(int i=0;i<n;i++){
int mx=0,mn=1e9;
for(int j=i;j<n;j++){
mx=max(mx,a[j]);
mn=min(mn,a[j]);
ans+=mint(mx)*mn;
// cout<<(mint(mx)*mn).val()<<endl;
}
}
cout<<ans.val()<<endl;
}