結果
問題 | No.360 増加門松列 |
ユーザー |
|
提出日時 | 2021-09-14 02:45:54 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 122 ms / 2,000 ms |
コード長 | 496 bytes |
コンパイル時間 | 792 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 77,824 KB |
最終ジャッジ日時 | 2024-06-26 05:03:13 |
合計ジャッジ時間 | 3,381 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
import itertoolsD=list(map(int,input().split()))list.sort(D)def isok(x):if x[0]==x[1] or x[1]==x[2] or x[0]==x[2]:return Falseif x[0]>x[1] and x[1]<x[2]:return Trueif x[0]<x[1] and x[1]>x[2]:return Truereturn Falseans=Falsepat=list(itertools.permutations(D))for p in pat:ret=Truefor i in range(5):ret&=isok(p[i:i+3])for i in range(5):ret&=p[i]<p[i+2]ans|=retif ans:print('YES')else:print('NO')