結果

問題 No.2942 Sigma Music Game Level Problem
ユーザー 👑 NachiaNachia
提出日時 2024-10-18 22:04:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 407 ms / 6,000 ms
コード長 1,248 bytes
コンパイル時間 740 ms
コンパイル使用メモリ 80,660 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-18 22:45:21
合計ジャッジ時間 8,478 ms
ジャッジサーバーID
(参考情報)
judge7 / judge
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
6,816 KB
testcase_01 AC 4 ms
6,816 KB
testcase_02 AC 4 ms
6,816 KB
testcase_03 AC 4 ms
6,816 KB
testcase_04 AC 4 ms
6,820 KB
testcase_05 AC 4 ms
6,816 KB
testcase_06 AC 4 ms
6,816 KB
testcase_07 AC 5 ms
6,824 KB
testcase_08 AC 4 ms
6,820 KB
testcase_09 AC 4 ms
6,820 KB
testcase_10 AC 3 ms
6,820 KB
testcase_11 AC 170 ms
6,820 KB
testcase_12 AC 373 ms
6,816 KB
testcase_13 AC 350 ms
6,816 KB
testcase_14 AC 190 ms
6,820 KB
testcase_15 AC 140 ms
6,820 KB
testcase_16 AC 320 ms
6,820 KB
testcase_17 AC 78 ms
6,816 KB
testcase_18 AC 224 ms
6,820 KB
testcase_19 AC 407 ms
6,816 KB
testcase_20 AC 118 ms
6,816 KB
testcase_21 AC 357 ms
6,816 KB
testcase_22 AC 348 ms
6,820 KB
testcase_23 AC 129 ms
6,824 KB
testcase_24 AC 4 ms
6,820 KB
testcase_25 AC 4 ms
6,816 KB
testcase_26 AC 362 ms
6,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using i64 = long long;
using u64 = unsigned long long;
#define rep(i,n) for(int i=0; i<int(n); i++)
const i64 INF = 1001001001001001001;
template<typename A> void chmin(A& l, const A& r){ if(r < l) l = r; }
template<typename A> void chmax(A& l, const A& r){ if(l < r) l = r; }
#include <atcoder/modint>
#include <atcoder/fenwicktree>
using Modint = atcoder::static_modint<998244353>;
using namespace std;

void testcase(){
    i64 N, Q, L0; cin >> N >> Q >> L0;
    i64 Z = 200001;
    atcoder::fenwick_tree<i64> C(Z+1), S(Z+1);
    rep(i,N){
        i64 a; cin >> a;
        C.add(a, 1);
        S.add(a, a);
    }
    i64 cnt_q2 = 0;
    rep(qi,Q){
        i64 t; cin >> t;
        if(t == 1){
            i64 l; cin >> l;
            C.add(l, 1);
            S.add(l, l);
        }
        if(t == 2){
            i64 l,r; cin >> l >> r;
            cout << C.sum(l,r+1) << " " << S.sum(l,r+1) << "\n";
            cnt_q2 += 1;
        }
        if(t == 3){
            i64 m; cin >> m;
            L0 = m;
        }
    }
    if(cnt_q2 == 0){ cout << "Not Found!\n"; }
}

int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    testcase();
    return 0;
}
0