結果

問題 No.2942 Sigma Music Game Level Problem
コンテスト
ユーザー 沙耶花
提出日時 2024-10-18 21:58:44
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 279 ms / 6,000 ms
コード長 779 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,658 ms
コンパイル使用メモリ 277,520 KB
実行使用メモリ 9,264 KB
最終ジャッジ日時 2026-07-06 00:16:16
合計ジャッジ時間 9,063 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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