-
Notifications
You must be signed in to change notification settings - Fork 0
/
CodeChef_DEVARRAY.cs
49 lines (44 loc) · 1.31 KB
/
CodeChef_DEVARRAY.cs
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
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MMT_Elitmus
{
class CodeChef_DEVARRAY
{
static void Main3(string[] dd)
{
string[] line = Console.ReadLine().Split(' ');
int arrLen = Convert.ToInt32(line[0]);
int queryLen = Convert.ToInt32(line[1]);
string[] arr = Console.ReadLine().Split(' ');
int minNum = Convert.ToInt32(arr[0]);
int maxNum = Convert.ToInt32(arr[0]);
foreach (var s in arr)
{
if (Convert.ToInt32(s) < minNum)
{
minNum = Convert.ToInt32(s);
}
else if (Convert.ToInt32(s) > maxNum)
{
maxNum = Convert.ToInt32(s);
}
}
while (queryLen > 0)
{
int t = Convert.ToInt32(Console.ReadLine());
if (t >= minNum && t <= maxNum)
{
Console.WriteLine("Yes");
}
else
{
Console.WriteLine("No");
}
queryLen--;
}
}
}
}