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: 26ms
Memory: 1716kB
Author: 2018212212174
In contest: 1269

#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f ;
int arr[1000] ;
int main(int argc, char const *argv[])
{
	int n,q ;
	while(scanf("%d %d",&n,&q)!=EOF)
	{
		memset(arr,inf,sizeof arr) ;
	
		while(q --)
		{
			int tmp ;
			cin >> tmp ;
			if(tmp == 1)
			{
				int a,b ;
				cin >> a >> b ;
				arr[a] = b ;
			}
			else
			{
				int tmppp ;
				cin >> tmppp ;
				if(arr[tmppp] == inf)
				{
					cout << "UMR!!!" << endl ;
				}
				else
					cout << arr[tmppp] << endl ;
			}
		}
	}
	
	return 0;
}