結果
| 問題 | No.3614 Breaking door keys(LITTLE BREAK ver.) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-06 21:30:04 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 535 ms / 2,000 ms |
| + 146µs | |
| コード長 | 792 bytes |
| 記録 | |
| コンパイル時間 | 2,407 ms |
| コンパイル使用メモリ | 345,892 KB |
| 実行使用メモリ | 16,636 KB |
| 最終ジャッジ日時 | 2026-08-06 21:30:24 |
| 合計ジャッジ時間 | 14,164 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| サンプル | 0 % | AC * 3 |
| 小課題1 | 10 % | AC * 7 |
| 小課題2 | 20 % | AC * 7 |
| 小課題3 | 30 % | AC * 7 |
| 小課題4 | 30 % | AC * 14 |
| 小課題5 | 10 % | AC * 38 |
| 合計 | 2.5 * 100% = 250 点 |
ソースコード
#include <atcoder/segtree>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using S = vector<int>;
S op(S a, S b) {
for (int i : b)
a.push_back(i);
sort(a.begin(), a.end());
while (a.size() > 10)
a.pop_back();
return a;
}
S e() {
return S();
}
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int n, q;
cin >> n >> q;
atcoder::segtree<S, op, e> seg(n);
rep(i, n) {
int s;
cin >> s;
seg.set(i, {s});
}
while (q--) {
int l, r, k;
cin >> l >> r >> k;
l--;
ll ans = 0;
S x = seg.prod(l, r);
rep(i, k) ans += x[i];
cout << ans << endl;
}
return 0;
}