-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path25A-IQTest.cs
42 lines (38 loc) · 1.01 KB
/
25A-IQTest.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
using System;
using System.Collections.Generic;
using System.Linq;
namespace Codeforces
{
class Program
{
static void Main(string[] args)
{
int N = Int32.Parse(Console.ReadLine());
int even=0, odd=0;
var str = Console.ReadLine().Split(' ').Select(Int32.Parse).ToArray();
int evenCount = str.Count(x => x%2 == 0);
if (evenCount == 1)
{
for (int i = 0; i < N; i++)
{
if (str[i]%2 == 0)
{
Console.WriteLine(i+1);
break;
}
}
}
else
{
for (int i = 0; i < N; i++)
{
if (str[i] % 2 == 1)
{
Console.WriteLine(i+1);
break;
}
}
}
}
}
}