結果

問題 No.360 増加門松列
ユーザー mkawa2mkawa2
提出日時 2019-12-26 22:49:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 635 ms / 2,000 ms
コード長 1,388 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 44,456 KB
最終ジャッジ日時 2024-04-15 12:15:15
合計ジャッジ時間 16,745 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 570 ms
43,988 KB
testcase_01 AC 575 ms
43,948 KB
testcase_02 AC 585 ms
44,324 KB
testcase_03 AC 576 ms
44,324 KB
testcase_04 AC 572 ms
44,196 KB
testcase_05 AC 581 ms
44,324 KB
testcase_06 AC 587 ms
44,324 KB
testcase_07 AC 579 ms
44,196 KB
testcase_08 AC 577 ms
44,068 KB
testcase_09 AC 563 ms
44,344 KB
testcase_10 AC 635 ms
43,936 KB
testcase_11 AC 595 ms
43,936 KB
testcase_12 AC 577 ms
44,200 KB
testcase_13 AC 576 ms
44,452 KB
testcase_14 AC 566 ms
44,456 KB
testcase_15 AC 582 ms
44,328 KB
testcase_16 AC 574 ms
44,324 KB
testcase_17 AC 591 ms
44,456 KB
testcase_18 AC 575 ms
44,208 KB
testcase_19 AC 580 ms
44,072 KB
testcase_20 AC 567 ms
44,068 KB
testcase_21 AC 574 ms
44,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *
from bisect import *
from math import *
from collections import *
from heapq import *
from random import *
import numpy as np
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    def check(aa):
        for a0, a1, a2 in zip(aa, aa[1:], aa[2:]):
            if a0 == a1 or a1 == a2 or a0 == a2: return False
            if a0 <= a1 <= a2: return False
        return True

    dd = LI()
    dd.sort()
    for odd in combinations(range(7), 3):
        ei = 0
        oi = 1
        aa = [0] * 7
        for i in range(7):
            if i in odd:
                aa[oi] = dd[i]
                oi += 2
            else:
                aa[ei] = dd[i]
                ei += 2
        # print(aa)
        if check(aa):
            print("YES")
            exit()
    print("NO")

main()
0