Submission #74119


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;
// strlen(n); nの文字数を取得
int main()
{
int n, a[131073], b, c, min;
string s;
cin >> n;
for(int i = 0; i < n; i++){
cin >> a[i];
}
cin >> s;
do{
cin >> b >> c;
min = 100000;
if(s == "update"){
a[b] = c;
}else if(s == "min"){
for(int i = b; i <= c; i++){
if(min > a[i]){
min = a[i];
}
}
cout << min << endl;
}
cin >> s;
}while(s != "exit");
return(0);
}
//セグメントツリー

ステータス

項目 データ
問題 0459 - セグメントツリー練習
ユーザー名 ei2212
投稿日時 2023-01-20 17:02:31
言語 C++17
状態 Accepted
得点 10
ソースコード長 699 Byte
最大実行時間 120 ms
最大メモリ使用量 1792 KB

セット

セット 得点 Cases
1 ALL 10 / 10 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 48 ms 604 KB
1
Input02 AC 18 ms 576 KB
1
Input03 AC 25 ms 412 KB
1
Input04 AC 18 ms 504 KB
1
Input05 AC 22 ms 600 KB
1
Input06 AC 21 ms 692 KB
1
Input07 AC 23 ms 528 KB
1
Input08 AC 25 ms 496 KB
1
Input09 AC 32 ms 716 KB
1
Input10 AC 120 ms 1792 KB
1