結果

問題 No.199 星を描こう
ユーザー niyarinniyarin
提出日時 2016-11-15 17:41:05
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 1,481 bytes
コンパイル時間 62 ms
コンパイル使用メモリ 6,652 KB
実行使用メモリ 6,084 KB
最終ジャッジ日時 2023-08-17 07:02:25
合計ジャッジ時間 1,611 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,952 KB
testcase_01 AC 12 ms
5,996 KB
testcase_02 AC 13 ms
5,948 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 13 ms
6,044 KB
testcase_09 WA -
testcase_10 AC 13 ms
6,004 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 11 ms
5,972 KB
testcase_15 AC 11 ms
5,852 KB
testcase_16 AC 10 ms
5,856 KB
testcase_17 AC 11 ms
5,952 KB
testcase_18 AC 11 ms
5,948 KB
testcase_19 AC 11 ms
5,860 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 12 ms
5,860 KB
testcase_23 AC 11 ms
5,904 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 11 ms
5,968 KB
testcase_27 AC 11 ms
5,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

dots = [map(int,raw_input().split(" ")) for i in range(5)]

def nyrn():
    for i in range(5):
        for j in range(i+1,5):
            for k in range(j+1,5):
                f1 = dots[i][1]-dots[j][1] == 0 
                f2 = dots[i][1]-dots[k][1] == 0 
                
                if f1 == f2 and f1:
                    return 0
                if f1 or f2:
                    continue
                if float(dots[i][0]-dots[j][0])/ (dots[i][1]-dots[j][1]) == float(dots[i][0]-dots[k][0])/(dots[i][1]-dots[k][1]):
                    return 0
    return 1

def nyrn2():
    for i in range(5):
        for j in range(5):
            for k in range(5):
                for l in range(5):
                    for m in range(5):
                        if len(set([i,j,k,l,m])) == 5:
                            v = [i,j,k,l,m]*2
                            flag = True
                            for n in range(1,6):
                                a = v[n-1]
                                b = v[n]
                                c = v[n+1]

                                if (dots[b][0]-dots[a][0])*(dots[b][0]-dots[c][0]) + (dots[b][1]-dots[a][1])*(dots[b][1]-dots[c][1])<0:
                                    flag = False
                                    break
                            if flag:
                                return 1
    return 0




                                

print "YES" if (nyrn() and nyrn2()) else "NO"


                


0