結果

問題 No.2942 Sigma Music Game Level Problem
ユーザー highlighterhighlighter
提出日時 2024-09-17 07:51:10
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 657 bytes
コンパイル時間 5,250 ms
コンパイル使用メモリ 309,964 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-06 10:48:36
合計ジャッジ時間 13,870 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
6,656 KB
testcase_01 WA -
testcase_02 AC 5 ms
6,528 KB
testcase_03 WA -
testcase_04 AC 5 ms
6,656 KB
testcase_05 AC 5 ms
6,528 KB
testcase_06 AC 5 ms
6,656 KB
testcase_07 AC 5 ms
6,528 KB
testcase_08 AC 5 ms
6,528 KB
testcase_09 AC 6 ms
6,528 KB
testcase_10 AC 6 ms
6,528 KB
testcase_11 AC 221 ms
6,528 KB
testcase_12 AC 464 ms
6,528 KB
testcase_13 AC 428 ms
6,656 KB
testcase_14 AC 233 ms
6,528 KB
testcase_15 AC 173 ms
6,528 KB
testcase_16 AC 375 ms
6,528 KB
testcase_17 AC 96 ms
6,528 KB
testcase_18 AC 286 ms
6,528 KB
testcase_19 AC 490 ms
6,528 KB
testcase_20 AC 146 ms
6,528 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 155 ms
6,528 KB
testcase_24 AC 4 ms
6,528 KB
testcase_25 AC 4 ms
6,656 KB
testcase_26 AC 518 ms
6,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define int long long

signed main(){
	int N,Q,b;
	scanf("%d%d%d",&N,&Q,&b);
	fenwick_tree<int> tree1(200001);
	fenwick_tree<long long> tree2(200001);
	for(;N--;){
		scanf("%d",&b);
		tree1.add(b,1);
		tree2.add(b,b);
	}
	bool check=false;
	for(;Q--;){
		scanf("%d",&b);
		if(b==3){
			scanf("%d",&b);
			continue;
		}
		if(b==2){
			check=true;
			int l,r;
			scanf("%d%d",&l,&r);
			printf("%d %lld\n",tree1.sum(l,r+1),tree2.sum(l,r+1));
			continue;
		}
		int l;
		scanf("%d",&l);
		tree1.add(l,1);
		tree2.add(l,l);
	}
	if(!check){
		printf("Not Find!\n");
	}
}
0