結果
問題 |
No.2942 Sigma Music Game Level Problem
|
ユーザー |
![]() |
提出日時 | 2024-09-17 10:55:23 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 671 bytes |
コンパイル時間 | 5,343 ms |
コンパイル使用メモリ | 308,604 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 21:54:22 |
合計ジャッジ時間 | 13,038 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 19 WA * 5 |
ソースコード
#include<bits/stdc++.h> #include<atcoder/all> using namespace std; using namespace atcoder; signed main(){ int N,Q,b; scanf("%d%d%d",&N,&Q,&b); fenwick_tree<long long> tree(200001); for(;N--;){ scanf("%d",&b); tree.add(b,1LL); tree.add(b,(long long)(b)*1000001LL); } 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); long long ans=tree.sum(l,r+1); printf("%lld %lld\n",ans%1000001LL,ans/1000001LL); continue; } long long l; scanf("%lld",&l); tree.add(l,1LL); tree.add(l,l*1000001LL); } if(!check){ printf("Not Find!\n"); } }