結果

問題 No.334 門松ゲーム
ユーザー
提出日時 2016-01-15 23:58:43
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 989 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 7,152 KB
実行使用メモリ 6,640 KB
最終ジャッジ日時 2023-10-19 23:44:12
合計ジャッジ時間 1,155 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 RE -
testcase_03 WA -
testcase_04 WA -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import copy
def func2(a,b,c):
  if a<c<b or b>c>a:
    return 1
  else:
    return 0


def func1(a,b,c,line):
  del line[a]
  del line[b-1]
  del line[c-2]
  if len(line)<4:
    return 1
  for i in range(len(line)):
    for j in range(len(line)):
      if j<=i:
        continue
      for k in range(len(line)):
        if k<=j:
          continue
        if func2(line[i],line[j],line[k])==1:
          ans=func3(i,j,k,line)
        if ans==1:
          return 1
  return 1

def main():
  num=input()
  line=map(int,raw_input().split(" "))
  ans=0
  tmp=0
  ansans=copy.deepcopy(line)
  for i in range(len(line)):
    for j in range(len(line)):
      if j<=i:
        continue
      for k in range(len(line)):
        if k<=j:
          continue
        tmp=func2(line[i],line[j],line[k])
        if tmp==1:
          abcd=copy.deepcopy(line)
          ans=func1(i,j,k,abcd)
        if ans==1:
          print str(ansans[i])+" "+str(ansans[j])+" "+str(ansans[k])
          return

main()
0