結果

問題 No.2942 Sigma Music Game Level Problem
ユーザー nouka28nouka28
提出日時 2024-10-18 21:43:30
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,556 ms / 6,000 ms
コード長 763 bytes
コンパイル時間 6,442 ms
コンパイル使用メモリ 311,528 KB
実行使用メモリ 26,796 KB
最終ジャッジ日時 2024-10-18 22:34:54
合計ジャッジ時間 21,467 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
18,788 KB
testcase_01 AC 7 ms
18,964 KB
testcase_02 AC 6 ms
18,948 KB
testcase_03 AC 7 ms
18,792 KB
testcase_04 AC 7 ms
18,832 KB
testcase_05 AC 6 ms
18,964 KB
testcase_06 AC 7 ms
19,016 KB
testcase_07 AC 8 ms
19,028 KB
testcase_08 AC 9 ms
18,960 KB
testcase_09 AC 8 ms
18,844 KB
testcase_10 AC 8 ms
19,028 KB
testcase_11 AC 540 ms
23,680 KB
testcase_12 AC 1,291 ms
24,964 KB
testcase_13 AC 1,363 ms
20,712 KB
testcase_14 AC 641 ms
24,948 KB
testcase_15 AC 413 ms
25,540 KB
testcase_16 AC 1,193 ms
20,128 KB
testcase_17 AC 249 ms
21,584 KB
testcase_18 AC 860 ms
21,528 KB
testcase_19 AC 1,556 ms
22,068 KB
testcase_20 AC 343 ms
23,336 KB
testcase_21 AC 896 ms
26,736 KB
testcase_22 AC 904 ms
26,720 KB
testcase_23 AC 544 ms
20,580 KB
testcase_24 AC 7 ms
18,956 KB
testcase_25 AC 7 ms
18,856 KB
testcase_26 AC 1,439 ms
26,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

#include<atcoder/all>
using namespace atcoder;
using mint=atcoder::modint998244353;

#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#define int long long

signed main(){
	int N,Q,L0;cin>>N>>Q>>L0;

	vector<int> A(N);for(auto&&e:A)cin>>e;

	const int max_Q=1000000;

	fenwick_tree<int> f(max_Q+1),g(max_Q+1);

	for(auto&&e:A)f.add(e,e),g.add(e,1);

	bool flg=0;

	while(Q--){
		int t;cin>>t;
		if(t==1){
			int l;cin>>l;
			f.add(l,l);
			g.add(l,1);
		}
		if(t==2){
			int l,r;cin>>l>>r;
			int res1=g.sum(0,r+1)-g.sum(0,l);
			int res2=f.sum(0,r+1)-f.sum(0,l);
			cout<<res1<<" "<<res2<<endl;
			flg=1;
		}
		if(t==3){
			int m;cin>>m;
			L0=m;
		}
	}

	if(flg==0){
		cout<<"Not Found!"<<endl;
	}
}
0