結果

問題 No.1017 Reiwa Sequence
ユーザー vwxyzvwxyz
提出日時 2023-07-15 06:38:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 569 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 11,000 KB
実行使用メモリ 116,976 KB
最終ジャッジ日時 2023-10-14 21:17:29
合計ジャッジ時間 61,452 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,568 KB
testcase_01 AC 19 ms
8,640 KB
testcase_02 AC 19 ms
8,668 KB
testcase_03 AC 19 ms
8,708 KB
testcase_04 AC 19 ms
8,508 KB
testcase_05 AC 19 ms
8,608 KB
testcase_06 AC 19 ms
8,628 KB
testcase_07 AC 19 ms
8,620 KB
testcase_08 AC 19 ms
8,516 KB
testcase_09 AC 22 ms
8,908 KB
testcase_10 AC 35 ms
9,344 KB
testcase_11 AC 25 ms
8,944 KB
testcase_12 AC 45 ms
9,848 KB
testcase_13 AC 21 ms
8,724 KB
testcase_14 AC 26 ms
8,992 KB
testcase_15 AC 33 ms
9,236 KB
testcase_16 AC 26 ms
8,956 KB
testcase_17 AC 75 ms
11,696 KB
testcase_18 AC 26 ms
9,072 KB
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 AC 1,446 ms
71,660 KB
testcase_28 AC 1,696 ms
93,956 KB
testcase_29 AC 68 ms
11,252 KB
testcase_30 AC 114 ms
13,952 KB
testcase_31 AC 275 ms
21,520 KB
testcase_32 AC 1,102 ms
59,972 KB
testcase_33 AC 51 ms
10,096 KB
testcase_34 AC 1,117 ms
59,756 KB
testcase_35 AC 19 ms
8,508 KB
testcase_36 AC 19 ms
8,720 KB
testcase_37 AC 1,095 ms
59,740 KB
testcase_38 AC 20 ms
8,600 KB
testcase_39 AC 1,087 ms
59,820 KB
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 AC 94 ms
19,300 KB
testcase_45 TLE -
testcase_46 TLE -
testcase_47 TLE -
testcase_48 AC 160 ms
25,896 KB
testcase_49 AC 139 ms
26,004 KB
testcase_50 AC 142 ms
24,732 KB
testcase_51 AC 19 ms
8,584 KB
testcase_52 TLE -
testcase_53 AC 536 ms
34,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline
from collections import defaultdict

N=int(readline())
A=list(map(int,readline().split()))
dct=defaultdict(list)
bit=1
while bit<1<<len(A):
    S=sum(A[i] for i in range(min(30,len(A))) if bit&1<<i)
    dct[S].append(bit)
    if len(dct[S])>=2:
        break
    bit+=1
else:
    print("No")
    exit()
bit0,bit1=dct[S][0],dct[S][1]
for i in range(len(A)):
    if i<30 and bit0&1<<i and not bit1&1<<i:
        A[i]*=-1
    elif i<30 and not bit0&1<<i and bit1&1<<i:
        A[i]*=1
    else:
        A[i]*=0
print("Yes")
print(*A)
0