Submission #5911663


Source Code Expand

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using static System.Console;
using static System.Math;

class Program
{
    static void Main(string[] args)
    {
        int N = ReadLineParseInt();
        KeyValuePair<int, int>[] pos = new KeyValuePair<int, int>[N];
        for(int i = 0; i < N; i++)
        {
            int[] xy = ReadLineParseIntArray();
            pos[i] = new KeyValuePair<int, int>(xy[0], xy[1]);
        }
        int ans = 0;
        for(int i = 0; i < N - 2; i++)
            for(int j = i + 1; j < N - 1; j++)
                for(int k = j + 1; k < N; k++)
                {
                    int x1 = pos[j].Key - pos[i].Key;
                    int y1 = pos[j].Value - pos[i].Value;
                    int x2 = pos[k].Key - pos[i].Key;
                    int y2 = pos[k].Value - pos[i].Value;
                    long v = Abs(x1 * y2 - y1 * x2);
                    if (v != 0 && v % 2 == 0)
                        ans++;
                }
        WriteLine(ans);
    }
    static int ReadLineParseInt() => int.Parse(ReadLine());
    static int[] ReadLineParseIntArray() => ReadLine().Split(' ').Select(int.Parse).ToArray();
}

Submission Info

Submission Time
Task A - BMI
User oziya
Language C# (Mono 4.6.2.0)
Score 0
Code Size 1237 Byte
Status RE
Exec Time 20 ms
Memory 12768 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
RE × 2
RE × 18
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All case_01.txt, case_02.txt, case_03.txt, case_04.txt, case_05.txt, case_06.txt, case_07.txt, case_08.txt, case_09.txt, case_10.txt, case_11.txt, case_12.txt, case_13.txt, case_14.txt, case_15.txt, case_16.txt, case_17.txt, case_18.txt
Case Name Status Exec Time Memory
case_01.txt RE 20 ms 10720 KB
case_02.txt RE 20 ms 10720 KB
case_03.txt RE 19 ms 10720 KB
case_04.txt RE 19 ms 10720 KB
case_05.txt RE 20 ms 10592 KB
case_06.txt RE 20 ms 10720 KB
case_07.txt RE 19 ms 10592 KB
case_08.txt RE 19 ms 8672 KB
case_09.txt RE 20 ms 10720 KB
case_10.txt RE 19 ms 8672 KB
case_11.txt RE 20 ms 12768 KB
case_12.txt RE 19 ms 10720 KB
case_13.txt RE 20 ms 12640 KB
case_14.txt RE 19 ms 8672 KB
case_15.txt RE 20 ms 10720 KB
case_16.txt RE 20 ms 10592 KB
case_17.txt RE 19 ms 10592 KB
case_18.txt RE 20 ms 12768 KB
sample_01.txt RE 19 ms 8672 KB
sample_02.txt RE 20 ms 10592 KB