Submission #15155662


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 ans = new long[](10_000_000);
    foreach (x; 1 .. 500)
        foreach (y; 1 .. 500)
            foreach (z; 1 .. 500)
            {
                long n = x * x + y * y + z * z + x * y + y * z + z * x;
                // dprint(x, y, z, n);
                ans[n]++;
            }
    foreach (i; 1 .. N + 1)
    {
        writeln(ans[i]);
    }
}

Submission Info

Submission Time
Task C - XYZ Triplets
User kotet
Language D (DMD 2.091.0)
Score 300
Code Size 979 Byte
Status AC
Exec Time 524 ms
Memory 81780 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 1
AC × 3
Set Name Test Cases
Sample sample_01.txt
All hand_01.txt, hand_02.txt, sample_01.txt
Case Name Status Exec Time Memory
hand_01.txt AC 524 ms 81732 KB
hand_02.txt AC 521 ms 81780 KB
sample_01.txt AC 511 ms 81756 KB