結果

問題 No.2942 Sigma Music Game Level Problem
ユーザー VvyLwVvyLw
提出日時 2024-10-18 23:46:30
言語 C++23(gcc13)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 454 ms / 6,000 ms
コード長 1,249 bytes
コンパイル時間 1,682 ms
コンパイル使用メモリ 114,956 KB
実行使用メモリ 7,424 KB
最終ジャッジ日時 2024-10-18 23:46:40
合計ジャッジ時間 9,832 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
7,424 KB
testcase_01 AC 5 ms
7,168 KB
testcase_02 AC 5 ms
7,168 KB
testcase_03 AC 5 ms
7,296 KB
testcase_04 AC 5 ms
7,296 KB
testcase_05 AC 5 ms
7,296 KB
testcase_06 AC 5 ms
7,296 KB
testcase_07 AC 5 ms
7,424 KB
testcase_08 AC 5 ms
7,296 KB
testcase_09 AC 5 ms
7,296 KB
testcase_10 AC 5 ms
7,168 KB
testcase_11 AC 193 ms
7,296 KB
testcase_12 AC 415 ms
7,296 KB
testcase_13 AC 375 ms
7,296 KB
testcase_14 AC 217 ms
7,296 KB
testcase_15 AC 165 ms
7,296 KB
testcase_16 AC 338 ms
7,296 KB
testcase_17 AC 90 ms
7,296 KB
testcase_18 AC 269 ms
7,296 KB
testcase_19 AC 454 ms
7,296 KB
testcase_20 AC 137 ms
7,296 KB
testcase_21 AC 401 ms
7,168 KB
testcase_22 AC 404 ms
7,296 KB
testcase_23 AC 148 ms
7,296 KB
testcase_24 AC 5 ms
7,424 KB
testcase_25 AC 5 ms
7,296 KB
testcase_26 AC 423 ms
7,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#ifdef local
#include <C++/core/io/debug_print.hpp>
#else
#define dump(...) void(0);
#endif

#include <iostream>
#include <ranges>
#include <atcoder/fenwicktree>
namespace man {

}
int main() {
    std::cin.tie(nullptr) -> sync_with_stdio(false);
    using namespace std::views;
    int n, q, l0;
    std::cin >> n >> q >> l0;
    atcoder::fenwick_tree<int64_t> cnt(1 << 18), bit(1 << 18);
    for([[maybe_unused]] const auto _: iota(0, n)) {
        int a;
        std::cin >> a;
        cnt.add(a, 1);
        bit.add(a, a);
    }
    bool none = true;
    for([[maybe_unused]] const auto _: iota(0, q)) {
        int t;
        std::cin >> t;
        if(t == 1) {
            int l;
            std::cin >> l;
            cnt.add(l, 1);
            bit.add(l, l);
        } else if(t == 2) {
            none = false;
            int l, r;
            std::cin >> l >> r;
            r++;
            std::cout << cnt.sum(l, r) << ' ' << bit.sum(l, r) << '\n';
        } else {
            int m;
            std::cin >> m;
        }
    }
    if(none) {
        std::cout << "Not Found!\n";
    }
}
0