結果

問題 No.1823 Tricolor Dango
ユーザー iii aaaiii aaa
提出日時 2022-01-29 21:03:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 815 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 10,860 KB
実行使用メモリ 16,192 KB
最終ジャッジ日時 2023-08-30 20:31:31
合計ジャッジ時間 8,356 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
12,432 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 TLE -
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)
        minDango = min(dango)
        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] -= minDango
            else:
                print("No")
                isLoopFlag=False
                break
0