結果

問題 No.1234 典型RMQ
ユーザー 紙ぺーぱー紙ぺーぱー
提出日時 2017-04-26 23:59:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 500 bytes
コンパイル時間 1,485 ms
コンパイル使用メモリ 164,192 KB
実行使用メモリ 8,396 KB
最終ジャッジ日時 2023-09-27 06:35:41
合計ジャッジ時間 17,962 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,396 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1,084 ms
4,380 KB
testcase_07 AC 241 ms
4,376 KB
testcase_08 AC 1,449 ms
4,380 KB
testcase_09 AC 756 ms
4,376 KB
testcase_10 AC 1,275 ms
4,384 KB
testcase_11 AC 1,021 ms
4,380 KB
testcase_12 AC 660 ms
4,376 KB
testcase_13 AC 269 ms
4,380 KB
testcase_14 AC 706 ms
4,380 KB
testcase_15 AC 539 ms
4,380 KB
testcase_16 AC 1,250 ms
4,376 KB
testcase_17 AC 705 ms
4,376 KB
testcase_18 AC 113 ms
4,376 KB
testcase_19 AC 1,412 ms
4,424 KB
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,N) for(int i=0;i<N;i++)
using namespace std;
typedef long long ll;
constexpr ll ten(int n){return n==0?1:10*ten(n-1);}
const int B=350;
const ll MX=ten(15);
int n,q;
ll a[ten(5)];
int main(){
	scanf("%d",&n);
	rep(i,n)scanf("%lld",&a[i]);
	scanf("%d",&q);
	rep(i,q){
		int k,l,r,c;
		scanf("%d%d%d%d",&k,&l,&r,&c);
		l--;
		if(k==1)for(int i=l;i<r;i++)a[i]+=c;
		else{
			ll ma=ten(18);
			for(int i=l;i<r;i++)ma=min(ma,a[i]);
			printf("%lld\n",ma);
		}

	}
}
0