結果
| 問題 | No.2065 Sum of Min |
| コンテスト | |
| ユーザー |
遭難者
|
| 提出日時 | 2022-05-20 09:40:18 |
| 言語 | C++17(gcc12) (gcc 12.4.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 994 bytes |
| 記録 | |
| コンパイル時間 | 5,505 ms |
| コンパイル使用メモリ | 160,180 KB |
| 最終ジャッジ日時 | 2025-01-29 09:38:48 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 TLE * 4 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <numeric>
#include <algorithm>
using namespace std;
using ll = long long;
//#include <atcoder/all>
// using namespace atcoder;
// using mint = modint;
#define rep(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
#define print(n) cout << (n) << endl
#define ALL(a) (a).begin(), (a).end()
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, q__;
cin >> n >> q__;
vector<ll> a(n);
rep(i, n) cin >> a[i];
for (int q_ = 0; q_ < q__; q_++)
{
int l, r;
ll x;
cin >> l >> r >> x;
l--;
long ans = 0;
for (int i = l; i < r; i++)
ans += min(a[i], x);
cout << ans << endl;
}
}
遭難者