結果

問題 No.2942 Sigma Music Game Level Problem
ユーザー 沙耶花沙耶花
提出日時 2024-10-18 21:58:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 517 ms / 6,000 ms
コード長 779 bytes
コンパイル時間 4,395 ms
コンパイル使用メモリ 262,904 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-10-18 22:43:47
合計ジャッジ時間 11,589 ms
ジャッジサーバーID
(参考情報)
judge5 / judge6
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
6,816 KB
testcase_01 AC 4 ms
6,940 KB
testcase_02 AC 4 ms
6,944 KB
testcase_03 AC 5 ms
6,940 KB
testcase_04 AC 5 ms
6,944 KB
testcase_05 AC 5 ms
6,940 KB
testcase_06 AC 4 ms
6,944 KB
testcase_07 AC 5 ms
6,944 KB
testcase_08 AC 5 ms
6,944 KB
testcase_09 AC 4 ms
6,940 KB
testcase_10 AC 5 ms
6,944 KB
testcase_11 AC 205 ms
6,944 KB
testcase_12 AC 467 ms
6,940 KB
testcase_13 AC 425 ms
6,940 KB
testcase_14 AC 241 ms
6,940 KB
testcase_15 AC 175 ms
6,940 KB
testcase_16 AC 381 ms
6,944 KB
testcase_17 AC 98 ms
6,948 KB
testcase_18 AC 297 ms
6,944 KB
testcase_19 AC 517 ms
6,944 KB
testcase_20 AC 154 ms
6,940 KB
testcase_21 AC 487 ms
6,940 KB
testcase_22 AC 495 ms
6,944 KB
testcase_23 AC 162 ms
6,944 KB
testcase_24 AC 5 ms
6,944 KB
testcase_25 AC 5 ms
6,944 KB
testcase_26 AC 497 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 1000000000000000000LL


int main(){
	
	long long N,Q,L;
	cin>>N>>Q>>L;
	
	fenwick_tree<long long> fc(200005),fs(200005);
	rep(i,N){
		int a;
		scanf("%d",&a);
		fc.add(a,1);
		fs.add(a,a);
	}
	int outs = 0;
	rep(_,Q){
		int t;
		scanf("%d", &t);
		if(t==1){
			int l;
			scanf("%d",&l);
			fc.add(l,1);
			fs.add(l,l);
		}
		else if(t==2){
			outs++;
			int l,r;
			scanf("%d %d",&l,&r);
			printf("%lld %lld\n",fc.sum(l,r+1),fs.sum(l,r+1));
		}
		else{
			int m;
			scanf("%d",&m);
		}
	}
	if(outs==0){
		cout<<"Not Found!"<<endl;
	}
	
	return 0;
}
0