結果

問題 No.2942 Sigma Music Game Level Problem
ユーザー AwashAmityOakAwashAmityOak
提出日時 2024-10-18 22:16:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,001 ms / 6,000 ms
コード長 2,818 bytes
コンパイル時間 3,826 ms
コンパイル使用メモリ 231,552 KB
実行使用メモリ 14,224 KB
最終ジャッジ日時 2024-10-18 22:49:14
合計ジャッジ時間 14,760 ms
ジャッジサーバーID
(参考情報)
judge / judge7
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
6,820 KB
testcase_01 AC 4 ms
6,812 KB
testcase_02 AC 4 ms
6,824 KB
testcase_03 AC 4 ms
6,816 KB
testcase_04 AC 5 ms
6,820 KB
testcase_05 AC 4 ms
6,820 KB
testcase_06 AC 4 ms
6,816 KB
testcase_07 AC 4 ms
6,816 KB
testcase_08 AC 5 ms
6,820 KB
testcase_09 AC 4 ms
6,820 KB
testcase_10 AC 5 ms
6,816 KB
testcase_11 AC 311 ms
11,144 KB
testcase_12 AC 812 ms
12,528 KB
testcase_13 AC 898 ms
8,320 KB
testcase_14 AC 363 ms
12,336 KB
testcase_15 AC 197 ms
13,060 KB
testcase_16 AC 790 ms
7,552 KB
testcase_17 AC 137 ms
8,960 KB
testcase_18 AC 545 ms
9,052 KB
testcase_19 AC 1,001 ms
9,472 KB
testcase_20 AC 175 ms
10,688 KB
testcase_21 AC 339 ms
14,224 KB
testcase_22 AC 336 ms
14,192 KB
testcase_23 AC 384 ms
7,936 KB
testcase_24 AC 4 ms
6,820 KB
testcase_25 AC 4 ms
6,820 KB
testcase_26 AC 876 ms
14,184 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'void input(T& ...)':
main.cpp:32:64: warning: fold-expressions only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   32 | template<class... T> inline void input(T&... a) { ((cin >> a), ...); }
      |                                                                ^~~
main.cpp: In function 'void print(const T&, const U& ...)':
main.cpp:33:110: warning: fold-expressions only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   33 | template<class T, class... U> inline void print(const T& a, const U&... b) { cout << a; ((cout << " " << b), ...); }
      |                                                                                                              ^~~

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using mint = modint998244353;
istream& operator>> (istream& is, mint& x) { long long _x; is >> _x; x = _x; return is; }
ostream& operator<< (ostream& os, const mint& x) { return os << x.val(); }
template<class T, class U>
ostream& operator<< (ostream& os, const pair<T, U>& x) { return os << "{" << x.first << ", " << x.second << "}"; }
#define int ll
#define OVERLOAD_REP(_1, _2, _3, name, ...) name
#define REP2(i, l, r) for (int i = (int)(l); i < (int)(r); ++i)
#define REP1(i, n) REP2(i, 0, n)
#define rep(...) OVERLOAD_REP(__VA_ARGS__, REP2, REP1)(__VA_ARGS__)
#define RREP2(i, r, l) for (int i = (int)(r)-1; i >= (int)(l); --i)
#define RREP1(i, n) RREP2(i, n, 0)
#define rrep(...) OVERLOAD_REP(__VA_ARGS__, RREP2, RREP1)(__VA_ARGS__)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define pb push_back
#define mp make_pair
#define mt make_tuple
const int INF = 4e18;
const int MOD = 998244353;
const int MOD1 = 1e9 + 7;
template<class T> inline bool chmax(T &a, T b) { return a < b ? a = b, 1 : 0; }
template<class T> inline bool chmin(T &a, T b) { return a > b ? a = b, 1 : 0; }
template<class T> T pow(T a, T b, T m) { return b ? b&1 ? a*pow(a, b^1, m)%m : pow(a*a%m, b>>1, m)%m : 1; }
template<class T> T pow(T a, T b) { return b ? b&1 ? pow(a, b^1)*a : pow(a*a, b>>1) : 1; }
template<class... T> inline void input(T&... a) { ((cin >> a), ...); }
template<class T, class... U> inline void print(const T& a, const U&... b) { cout << a; ((cout << " " << b), ...); }
template<class T, class... U> inline void println(const T& a, const U&... b) { print(a, b...); cout << endl; }
inline void println() { cout << endl; }
template<class T> inline void print(vector<T>& A) { rep(i, A.size()) if (i) print("", A[i]); else print(A[i]); }
template<class T> inline void println(vector<T>& A) { print(A); cout << endl; }
const int di[8] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int dj[8] = {0, -1, 0, 1, -1, 1, -1, 1};

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int N, Q, L;
    input(N, Q, L);
    vector<int> A(N);
    rep(i, N) input(A[i]);
    
    fenwick_tree<int> nums(200000+1);
    fenwick_tree<int> sums(200000+1);
    
    rep(i, N) {
    	nums.add(A[i], 1);
    	sums.add(A[i], A[i]);
    }
    
    bool not_found = true;
    rep(q, Q) {
    	int t;
    	input(t);
    	if (t == 1) {
    		int l;
    		input(l);
    		
	    	nums.add(l, 1);
	    	sums.add(l, l);
    	} else if (t == 2) {
    		int l, r;
    		input(l, r);
    		++r;
    		
    		println(nums.sum(l, r), sums.sum(l, r));
    		not_found = false;
    	} else {
    		int m;
    		input(m);
    	}
    }
    if (not_found) println("Not Found!");
}
0