結果
| 問題 | No.1441 MErGe |
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2021-02-08 16:23:30 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 630 bytes |
| 記録 | |
| コンパイル時間 | 1,430 ms |
| コンパイル使用メモリ | 211,772 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-17 18:00:11 |
| 合計ジャッジ時間 | 26,924 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 TLE * 12 |
ソースコード
#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,0LL);
rep(i,N){
scanf("%lld",&S[i]);
}
rep(_,Q){
int T,l,r;
scanf("%d %d %d",&T,&l,&r);
l--;r--;
if(T==1){
for(int i=l+1;i<=r;i++)S[l] += S[i];
S.erase(S.begin()+l+1,S.begin()+r+1);
}
else{
long long ans = 0LL;
for(int i=l;i<=r;i++)ans += S[i];
printf("%lld\n",ans);
}
}
return 0;
}
沙耶花