結果

問題 No.1823 Tricolor Dango
ユーザー iii aaaiii aaa
提出日時 2022-01-29 20:58:53
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 778 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 86,484 KB
最終ジャッジ日時 2023-08-30 20:24:34
合計ジャッジ時間 4,120 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
75,572 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
import heapq

def inputSynario():
    input = stdin.readline
    num_list = []
    T = int(input().rstrip())
    for i in range(T * 2):
        num_list.append(list(map(int, input().rstrip().split())))
    return num_list

synario = inputSynario()
for synarioId in range(len(synario)//2):
    N=synario[synarioId * 2]
    A=synario[synarioId * 2 + 1]
    isLoopFlag=True
    while(isLoopFlag):
        dango=heapq.nlargest(3,A)
        if(dango[0]==0):
            print("Yes")
            isLoopFlag=False
            break
        for i in range(3):
            if(dango[i] != 0):
                index = A.index(dango[i])
                A[index] -= 1
            else:
                print("No")
                isLoopFlag=False
                break
0