結果

問題 No.3612 Breaking door keys(ALL BREAK ver.)
コンテスト
ユーザー mocchi
提出日時 2026-08-06 14:36:49
言語 C++23(gnu拡張gcc16)
(gcc 16.1.0 + boost 1.90.0)
コンパイル:
g++-16 -O2 -lm -std=gnu++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 318 ms / 2,000 ms
+ 816µs
コード長 629 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,193 ms
コンパイル使用メモリ 352,036 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-08-06 14:36:59
合計ジャッジ時間 9,209 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
サブタスク 配点 結果
サンプル 0 % AC * 3
小課題1 40 % AC * 7
小課題2 40 % AC * 7
小課題3 20 % AC * 24
合計 1.5 * 100% = 150 点
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <cassert>
#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i = 0; i < (int)(n); i++)
constexpr int inf = 2e9;
/*
#include <atcoder/all>
using namespace atcoder;

#include <boost/multiprecision/cpp_int.hpp>
#include <boost/math/common_factor_rt.hpp>
namespace mp = boost::multiprecision;
*/
using ll = long long;
int main()
{
    int N,Q;
    cin >> N >> Q;
    vector S(N + 1,0LL);
    for (int i = 1; i <= N; i++) cin >> S[i];
    for (int i = 1; i <= N; i++) S[i] += S[i - 1];
    while (Q--)
    {
        int l,r,k;
        cin >> l >> r >> k;
        cout << S[r] - S[l - 1] << "\n";
    }
}
0