Submission #3228763


Source Code Expand

using static System.Console;
using static System.Convert;

class Program
{
    static void Main(string[] args)
    {
        var input = ReadLine().Split(' ');
        var max = ToInt32(input[0]);
        var num = ToInt32(input[1]);
        var result = 0;
        for(var i = 0; i <= max; i++)
        {
            for(var j = 0; j <= max; j++)
            {
                if (i < j) break;
                for(var h = 0; h <= max; h++)
                {
                    if (j < h) break;
                    if (i + j + h == num)
                    {
                        if (i == j && j == h && h == i) result++;
                        else if (i == j || j == h || h == i) result += 3;
                        else result += 6;
                    }
                }
            }
        }

        WriteLine(result);
    }
}

Submission Info

Submission Time
Task B - Sum of Three Integers
User hibatibati
Language C# (Mono 4.6.2.0)
Score 0
Code Size 874 Byte
Status TLE
Exec Time 2108 ms
Memory 11220 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 2
AC × 8
TLE × 2
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All sample_01.txt, sample_02.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt
Case Name Status Exec Time Memory
sample_01.txt AC 20 ms 9172 KB
sample_02.txt AC 20 ms 11220 KB
subtask_1_01.txt TLE 2108 ms 8416 KB
subtask_1_02.txt AC 217 ms 9172 KB
subtask_1_03.txt TLE 2107 ms 8416 KB
subtask_1_04.txt AC 310 ms 9172 KB
subtask_1_05.txt AC 21 ms 11220 KB
subtask_1_06.txt AC 58 ms 9172 KB
subtask_1_07.txt AC 1454 ms 9172 KB
subtask_1_08.txt AC 36 ms 9172 KB