結果

問題 No.1017 Reiwa Sequence
ユーザー Kiri8128Kiri8128
提出日時 2020-04-03 22:13:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 647 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 162,928 KB
最終ジャッジ日時 2023-09-16 02:15:35
合計ジャッジ時間 16,400 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
136,856 KB
testcase_01 AC 90 ms
136,944 KB
testcase_02 AC 90 ms
136,904 KB
testcase_03 AC 92 ms
136,880 KB
testcase_04 AC 90 ms
137,152 KB
testcase_05 AC 90 ms
136,848 KB
testcase_06 AC 92 ms
136,652 KB
testcase_07 AC 93 ms
136,808 KB
testcase_08 AC 92 ms
136,864 KB
testcase_09 AC 95 ms
141,808 KB
testcase_10 AC 94 ms
141,852 KB
testcase_11 AC 96 ms
141,860 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 96 ms
141,904 KB
testcase_15 AC 96 ms
141,864 KB
testcase_16 AC 99 ms
141,804 KB
testcase_17 AC 96 ms
142,084 KB
testcase_18 AC 96 ms
141,824 KB
testcase_19 AC 115 ms
142,020 KB
testcase_20 AC 119 ms
141,748 KB
testcase_21 AC 120 ms
141,964 KB
testcase_22 AC 120 ms
141,828 KB
testcase_23 AC 118 ms
141,900 KB
testcase_24 AC 118 ms
141,908 KB
testcase_25 AC 114 ms
142,020 KB
testcase_26 AC 111 ms
141,784 KB
testcase_27 AC 111 ms
141,900 KB
testcase_28 AC 114 ms
141,744 KB
testcase_29 AC 96 ms
141,760 KB
testcase_30 AC 96 ms
141,744 KB
testcase_31 AC 98 ms
141,900 KB
testcase_32 AC 106 ms
141,804 KB
testcase_33 AC 96 ms
141,744 KB
testcase_34 AC 108 ms
142,028 KB
testcase_35 AC 91 ms
136,888 KB
testcase_36 AC 90 ms
136,848 KB
testcase_37 AC 108 ms
141,868 KB
testcase_38 AC 92 ms
136,868 KB
testcase_39 AC 110 ms
141,824 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 90 ms
136,900 KB
testcase_52 AC 113 ms
141,856 KB
testcase_53 AC 99 ms
141,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = [int(a) for a in input().split()]
K = min(N, 22)
B = A[:K]

D = {1<<i: i for i in range(22)}
X = [0] * (1 << 22)
Y = [0] * (1 << 22)
for i in range(1, 1 << K):
    l = i & (-i)
    if i == l:
        x = B[D[l]]
    else:
        x = X[i^l] + B[D[l]]
    X[i] = x
    if Y[x]:
        j = Y[x]
        k = i & j
        i ^= k
        j ^= k
        for s in range(K):
            if i >> s & 1:
                pass
            elif j >> s & 1:
                A[s] *= -1
            else:
                A[s] = 0
        print("Yes")
        print(*A)
        
        break
    else:
        Y[x] = i
else:
    print("No")
0