結果

問題 No.199 星を描こう
ユーザー niyarinniyarin
提出日時 2016-11-15 17:41:05
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 1,481 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-04 13:56:14
合計ジャッジ時間 1,248 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,016 KB
testcase_01 AC 10 ms
6,144 KB
testcase_02 AC 10 ms
6,272 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 11 ms
6,144 KB
testcase_09 WA -
testcase_10 AC 10 ms
6,272 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 9 ms
6,144 KB
testcase_15 AC 9 ms
6,272 KB
testcase_16 AC 8 ms
6,144 KB
testcase_17 AC 9 ms
6,272 KB
testcase_18 AC 9 ms
6,272 KB
testcase_19 AC 8 ms
6,272 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 8 ms
6,144 KB
testcase_23 AC 9 ms
6,144 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 8 ms
6,272 KB
testcase_27 AC 9 ms
6,144 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