-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1237.cpp
More file actions
executable file
·40 lines (38 loc) · 763 Bytes
/
1237.cpp
File metadata and controls
executable file
·40 lines (38 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int d;
cin>>d;
string s[d];
int arr[d][2];
int count=d,i=0;
while(count--)
{
scanf("%s%d%d",s[i],&arr[i][0],&arr[i][1]);
i++;
}
int q;cin>>q;
int p,st;
count=0;
while(q--)
{
cin>>p;
for(int i=0; i<d; i++)
{
if(p>=arr[i][0]&&p<=arr[i][1])
{
count++;
st=i;
}
}
if(count==0 || count>1)cout<<"UNDETERMINED"<<endl;
else cout<<s[i]<<endl;
}
cout<<endl;
}
}