Pagini recente » Cod sursa (job #404964) | Cod sursa (job #704967) | Cod sursa (job #801466) | Cod sursa (job #456089) | Cod sursa (job #801464)
Cod sursa(job #801464)
#include <cstdio>
#include <climits>
int v[100000];
int main()
{
int n,m;
freopen("arbint.in","r",stdin);
freopen("arbint.out","w",stdout);
scanf("%d%d",&n,&m);
for(int i =1; i<=n; i++)
scanf("%d",&v[i]);
for(int i =0; i<m; i++)
{
int x,a,b;
scanf("%d%d%d",&x,&a,&b);
if(!x)
{
int max = -INT_MAX;
for(int j = a; j<=b;j++)
if(v[j]>max)
max = v[j];
printf("%d\n",max);
}
else
v[a] = b;
}
return 0;
}