結果

問題 No.1017 Reiwa Sequence
ユーザー ayaoniayaoni
提出日時 2020-11-26 13:55:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 352 ms / 2,000 ms
コード長 533 bytes
コンパイル時間 372 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 132,572 KB
最終ジャッジ日時 2023-10-01 03:19:25
合計ジャッジ時間 21,197 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
97,084 KB
testcase_01 AC 99 ms
97,172 KB
testcase_02 AC 98 ms
97,216 KB
testcase_03 AC 102 ms
101,584 KB
testcase_04 AC 99 ms
97,108 KB
testcase_05 AC 103 ms
97,120 KB
testcase_06 AC 102 ms
97,012 KB
testcase_07 AC 99 ms
97,092 KB
testcase_08 AC 99 ms
97,308 KB
testcase_09 AC 109 ms
102,160 KB
testcase_10 AC 106 ms
102,280 KB
testcase_11 AC 107 ms
102,300 KB
testcase_12 AC 107 ms
102,148 KB
testcase_13 AC 106 ms
102,400 KB
testcase_14 AC 107 ms
102,480 KB
testcase_15 AC 105 ms
102,012 KB
testcase_16 AC 109 ms
102,300 KB
testcase_17 AC 109 ms
102,308 KB
testcase_18 AC 109 ms
102,348 KB
testcase_19 AC 275 ms
106,084 KB
testcase_20 AC 276 ms
105,956 KB
testcase_21 AC 273 ms
106,036 KB
testcase_22 AC 280 ms
106,100 KB
testcase_23 AC 273 ms
105,948 KB
testcase_24 AC 276 ms
105,736 KB
testcase_25 AC 260 ms
105,868 KB
testcase_26 AC 255 ms
105,976 KB
testcase_27 AC 233 ms
106,080 KB
testcase_28 AC 244 ms
106,024 KB
testcase_29 AC 106 ms
102,336 KB
testcase_30 AC 113 ms
102,328 KB
testcase_31 AC 124 ms
102,364 KB
testcase_32 AC 205 ms
105,776 KB
testcase_33 AC 110 ms
102,388 KB
testcase_34 AC 215 ms
106,136 KB
testcase_35 AC 98 ms
96,884 KB
testcase_36 AC 104 ms
101,488 KB
testcase_37 AC 214 ms
105,864 KB
testcase_38 AC 100 ms
97,132 KB
testcase_39 AC 219 ms
106,000 KB
testcase_40 AC 352 ms
117,596 KB
testcase_41 AC 342 ms
117,568 KB
testcase_42 AC 342 ms
116,164 KB
testcase_43 AC 342 ms
116,108 KB
testcase_44 AC 148 ms
120,176 KB
testcase_45 AC 346 ms
117,572 KB
testcase_46 AC 323 ms
115,976 KB
testcase_47 AC 292 ms
116,104 KB
testcase_48 AC 187 ms
132,572 KB
testcase_49 AC 163 ms
132,084 KB
testcase_50 AC 168 ms
132,396 KB
testcase_51 AC 100 ms
97,124 KB
testcase_52 AC 253 ms
105,948 KB
testcase_53 AC 135 ms
102,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))


N = I()
A = LI()[:22]
M = len(A)

flag = [None]*3300001
ans = [0]*M
for i in range(1<<M):
    x = 0
    for j in range(M):
        if (i>>j) & 1:
            x += A[j]
    if flag[x]:
        print('Yes')
        for j in range(M):
            ans[j] = (((i>>j) & 1)-((flag[x]>>j) & 1))*A[j]
        break
    else:
        flag[x] = i
else:
    print('No')
    exit()

ans += [0]*(N-M)
print(*ans)
0