結果

問題 No.1017 Reiwa Sequence
ユーザー lemondolemondo
提出日時 2020-12-23 10:39:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 879 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 81,636 KB
実行使用メモリ 140,164 KB
最終ジャッジ日時 2023-10-21 15:05:12
合計ジャッジ時間 34,841 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,364 KB
testcase_01 AC 36 ms
53,360 KB
testcase_02 AC 35 ms
53,364 KB
testcase_03 AC 41 ms
59,544 KB
testcase_04 AC 35 ms
53,364 KB
testcase_05 AC 37 ms
53,364 KB
testcase_06 AC 37 ms
53,364 KB
testcase_07 AC 36 ms
53,364 KB
testcase_08 AC 37 ms
53,364 KB
testcase_09 AC 46 ms
62,316 KB
testcase_10 AC 47 ms
64,364 KB
testcase_11 AC 46 ms
62,320 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 45 ms
62,316 KB
testcase_15 AC 45 ms
64,360 KB
testcase_16 AC 44 ms
62,316 KB
testcase_17 AC 50 ms
69,840 KB
testcase_18 AC 44 ms
62,316 KB
testcase_19 AC 339 ms
140,164 KB
testcase_20 AC 349 ms
140,160 KB
testcase_21 AC 352 ms
140,160 KB
testcase_22 AC 352 ms
140,164 KB
testcase_23 AC 337 ms
140,164 KB
testcase_24 AC 345 ms
140,164 KB
testcase_25 AC 327 ms
140,164 KB
testcase_26 AC 319 ms
140,164 KB
testcase_27 AC 232 ms
116,740 KB
testcase_28 AC 261 ms
122,564 KB
testcase_29 AC 49 ms
71,376 KB
testcase_30 AC 60 ms
78,000 KB
testcase_31 AC 84 ms
84,216 KB
testcase_32 AC 185 ms
101,340 KB
testcase_33 AC 50 ms
68,596 KB
testcase_34 AC 201 ms
101,340 KB
testcase_35 AC 35 ms
53,364 KB
testcase_36 AC 44 ms
59,472 KB
testcase_37 AC 194 ms
101,336 KB
testcase_38 AC 36 ms
53,364 KB
testcase_39 AC 196 ms
101,336 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 36 ms
53,360 KB
testcase_52 AC 345 ms
140,160 KB
testcase_53 AC 115 ms
90,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return list(map(int, input().split()))
sys.setrecursionlimit(10**9)

N = int(input())
As = mapint()

over22 = False
if N>=22:
    diff = N-22
    N = 22
    over22 = True
    exit()

used = {}
for i in range(1<<N):
    tmp = 0
    lis = []
    for j in range(N):
        if (i>>j)&1:
            tmp += As[j]
            lis.append(As[j])
        else:
            lis.append(0)
    
    if tmp in used:
        neg_lis = []
        neg_i = used[tmp]
        for j in range(N):
            if (neg_i>>j)&1:
                neg_lis.append(-As[j])
            else:
                neg_lis.append(0)
        for i in range(N):
            lis[i] += neg_lis[i]
        print('Yes')
        if over22:
            lis.extend([0]*diff)
        print(*lis)
        exit()
    used[tmp] = i
else:
    print('No')
0