hiho week 18 register

Ended

Participants:468

Verdict:Accepted
Score:100 / 100
Submitted:2014-11-01 21:03:27

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <cstdio>
int main()
{
    int N,Q;
    scanf("%d",&N);
    int a[10000];
    for(int i = 0; i < N; i++) scanf("%d",&a[i]);
    scanf("%d",&Q);
    for(int i = 0; i < Q; i++) {
        int x,y,z;
        scanf("%d %d %d",&x,&y,&z);
        if(x==0) {
            int m = 100000;
            for(int j = y-1; j < z; j++) if(m>a[j]) m = a[j];
            printf("%d\n",m);
        } else {
            a[y-1] = z;
        }
    }
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX