Result: Accepted
Time: 6ms
Memory: 1716kB
#include<cstdio>
#include<cmath>
#include<cstring>
#include<map>
#include<set>
#include<vector>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
const int maxn = 1010;
const int inf=0x3f3f3f3f;
typedef long long ll;
int n,m,k,t;
int x,y,z;
int a[maxn];
char b[maxn];
int main()
{
while(scanf("%d %d",&n,&m)!=EOF)
{
memset(a,inf,sizeof a);
while(m--)
{
scanf("%d",&x);
if(x==2)
{
scanf("%d",&y);
if(a[y]==inf)
printf("UMR!!!\n");
else
printf("%d\n",a[y]);
}
else
{
scanf("%d %d",&y,&z);
a[y]=z;
}
}
}
}