結果

問題 No.2942 Sigma Music Game Level Problem
ユーザー 沙耶花
提出日時 2024-10-18 21:58:44
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 606 ms / 6,000 ms
コード長 779 bytes
コンパイル時間 5,128 ms
コンパイル使用メモリ 251,804 KB
最終ジャッジ日時 2025-02-24 20:44:11
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |                 scanf("%d",&a);
      |                 ~~~~~^~~~~~~~~
main.cpp:27:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   27 |                 scanf("%d", &t);
      |                 ~~~~~^~~~~~~~~~
main.cpp:30:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   30 |                         scanf("%d",&l);
      |                         ~~~~~^~~~~~~~~
main.cpp:37:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   37 |                         scanf("%d %d",&l,&r);
      |                         ~~~~~^~~~~~~~~~~~~~~
main.cpp:42:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   42 |                         scanf("%d",&m);
      |                         ~~~~~^~~~~~~~~

ソースコード

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