結果
| 問題 | No.1441 MErGe |
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2021-02-08 16:27:19 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 585 bytes |
| 記録 | |
| コンパイル時間 | 1,469 ms |
| コンパイル使用メモリ | 212,380 KB |
| 実行使用メモリ | 7,968 KB |
| 最終ジャッジ日時 | 2026-06-17 18:00:37 |
| 合計ジャッジ時間 | 13,064 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 26 TLE * 2 |
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000000000000
int main(){
int N,Q;
scanf("%d %d",&N,&Q);
vector<long long> S(N+1,0LL);
rep(i,N){
scanf("%lld",&S[i+1]);
S[i+1] += S[i];
}
rep(_,Q){
int T,l,r;
scanf("%d %d %d",&T,&l,&r);
l--;r--;
if(T==1){
S.erase(S.begin()+l+1,S.begin()+r+1);
}
else{
long long ans = S[r+1] - S[l];
printf("%lld\n",ans);
}
}
return 0;
}
沙耶花