Start: Jun, 05, 2019 13:00:00
2019春ACM通识课考试(第一场)
End: Jun, 05, 2019 16:00:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 7ms
Memory: 1092kB
Author: Cherry
In contest: 1269

#include<stdio.h>
int main()
{
	int n,q,i;
	int a[110]={0},b;
	int type;
	int pos;
	

	    
	while(scanf("%d %d",&n,&q)!=EOF)
	{
	    for(i=0;i<n;i++)
	        a[i]=-1;
	    while(q--)
	    {
		    scanf("%d",&type);
		    if(type==1)
		    {
			    scanf("%d %d",&pos,&b);
		    	a[pos]=b;
	    	}
		    if(type==2)
		    {
			    scanf("%d",&pos);
			    if(a[pos]==-1)
			        printf("UMR!!!\n");
			    else printf("%d\n",a[pos]);
		    }
		
	    }
	 
    }
	return 0;
}