Submission #630040


Source Code Expand

import itertools
n = int(input())
points = [list(map(int, input().split())) for _ in range(n)]
ei, choku, don = 0, 0, 0
calclengths = lambda x1, y1, x2, y2: \
    abs((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
for elems in list(itertools.combinations(points, 3)):
    i = calclengths(elems[0][0], elems[0][1], elems[1][0], elems[1][1])
    j = calclengths(elems[1][0], elems[1][1], elems[2][0], elems[2][1])
    k = calclengths(elems[2][0], elems[2][1], elems[0][0], elems[0][1])
    temp = sorted([i, j, k])
    if temp[2] == temp[1] + temp[0]:
        choku += 1
    elif temp[2] > temp[1] + temp[0]:
        don += 1
    else:
        ei += 1
print(ei, choku, don)

Submission Info

Submission Time
Task D - 三角形の分類
User yumechi
Language Python (3.4.2)
Score 30
Code Size 676 Byte
Status TLE
Exec Time 7122 ms
Memory 577600 KB

Judge Result

Set Name sample subtask01 subtask02
Score / Max Score 0 / 0 30 / 30 0 / 70
Status
AC × 2
AC × 28
AC × 28
TLE × 26
Set Name Test Cases
sample sample-01.txt, sample-02.txt
subtask01 01-00.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-handmade00.txt, 01-handmade01.txt, 01-handmade02.txt, 01-handmade03.txt, 01-handmade04.txt, 01-handmade05.txt, sample-01.txt, sample-02.txt
subtask02 01-00.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-handmade00.txt, 01-handmade01.txt, 01-handmade02.txt, 01-handmade03.txt, 01-handmade04.txt, 01-handmade05.txt, 02-00.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt, 02-13.txt, 02-14.txt, 02-15.txt, 02-16.txt, 02-17.txt, 02-18.txt, 02-19.txt, 02-handmade00.txt, 02-handmade01.txt, 02-handmade02.txt, 02-handmade03.txt, 02-handmade04.txt, 02-handmade05.txt, sample-01.txt, sample-02.txt
Case Name Status Exec Time Memory
01-00.txt AC 616 ms 7268 KB
01-01.txt AC 117 ms 6920 KB
01-02.txt AC 100 ms 6796 KB
01-03.txt AC 103 ms 6756 KB
01-04.txt AC 111 ms 6800 KB
01-05.txt AC 170 ms 7504 KB
01-06.txt AC 163 ms 7524 KB
01-07.txt AC 1138 ms 19624 KB
01-08.txt AC 1143 ms 19620 KB
01-09.txt AC 1194 ms 19756 KB
01-10.txt AC 1200 ms 19648 KB
01-11.txt AC 1175 ms 19660 KB
01-12.txt AC 1186 ms 19704 KB
01-13.txt AC 1179 ms 19672 KB
01-14.txt AC 1213 ms 19748 KB
01-15.txt AC 1181 ms 19752 KB
01-16.txt AC 1181 ms 19656 KB
01-17.txt AC 1189 ms 19848 KB
01-18.txt AC 1180 ms 19628 KB
01-19.txt AC 1165 ms 19756 KB
01-handmade00.txt AC 222 ms 8292 KB
01-handmade01.txt AC 1195 ms 19668 KB
01-handmade02.txt AC 414 ms 10764 KB
01-handmade03.txt AC 1137 ms 18860 KB
01-handmade04.txt AC 1173 ms 19624 KB
01-handmade05.txt AC 1178 ms 19620 KB
02-00.txt TLE 7048 ms 111036 KB
02-01.txt TLE 7101 ms 577340 KB
02-02.txt TLE 7098 ms 577360 KB
02-03.txt TLE 7122 ms 577300 KB
02-04.txt TLE 7099 ms 577336 KB
02-05.txt TLE 7099 ms 577404 KB
02-06.txt TLE 7106 ms 577428 KB
02-07.txt TLE 7104 ms 577424 KB
02-08.txt TLE 7107 ms 577408 KB
02-09.txt TLE 7109 ms 577448 KB
02-10.txt TLE 7101 ms 577440 KB
02-11.txt TLE 7105 ms 577444 KB
02-12.txt TLE 7100 ms 577452 KB
02-13.txt TLE 7105 ms 577572 KB
02-14.txt TLE 7104 ms 577556 KB
02-15.txt TLE 7099 ms 577552 KB
02-16.txt TLE 7108 ms 577548 KB
02-17.txt TLE 7101 ms 577556 KB
02-18.txt TLE 7100 ms 577564 KB
02-19.txt TLE 7100 ms 577600 KB
02-handmade00.txt TLE 7098 ms 577492 KB
02-handmade01.txt TLE 7102 ms 577552 KB
02-handmade02.txt TLE 7102 ms 577524 KB
02-handmade03.txt TLE 7107 ms 577572 KB
02-handmade04.txt TLE 7102 ms 577600 KB
02-handmade05.txt TLE 7104 ms 577520 KB
sample-01.txt AC 128 ms 6752 KB
sample-02.txt AC 95 ms 6756 KB