Pagini recente » Cod sursa (job #2980513) | Istoria paginii utilizator/raresegay | Cod sursa (job #441815) | Cod sursa (job #404961) | Cod sursa (job #801448)
Cod sursa(job #801448)
#include <cstdio>
#include <climits>
int v[100000];
int main()
{
int n,m;
freopen("arbint.in","r",stdin);
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;
}