Submission #15149181


Source Code Expand

Copy
// dfmt off
T lread(T=long)(){return readln.chomp.to!T;}T[] lreads(T=long)(long n){return iota(n).map!((_)=>lread!T).array;}
T[] aryread(T=long)(){return readln.split.to!(T[]);}void arywrite(T)(T a){a.map!text.join(' ').writeln;}
void scan(L...)(ref L A){auto l=readln.split;foreach(i,T;L){A[i]=l[i].to!T;}}alias sread=()=>readln.chomp();
void dprint(L...)(lazy L A){debug{auto l=new string[](L.length);static foreach(i,a;A)l[i]=a.text;arywrite(l);}}
static immutable MOD=10^^9+7;alias PQueue(T,alias l="b<a")=BinaryHeap!(Array!T,l);import std;
// dfmt on

void main()
{
    long N = lread();
    auto A = aryread();
    long ans;
    foreach (i, a; A)
    {
        if (((i + 1) & 1) && (a & 1))
            ans++;
    }
    writeln(ans);
}

Submission Info

Submission Time
Task B - An Odd Problem
User kotet
Language D (DMD 2.091.0)
Score 200
Code Size 762 Byte
Status AC
Exec Time 9 ms
Memory 3640 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 7
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
random_01.txt AC 9 ms 3608 KB
random_02.txt AC 2 ms 3512 KB
random_03.txt AC 2 ms 3468 KB
random_04.txt AC 2 ms 3536 KB
random_05.txt AC 2 ms 3540 KB
sample_01.txt AC 2 ms 3632 KB
sample_02.txt AC 2 ms 3640 KB