結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,664 KB
testcase_01 AC 19 ms
8,560 KB
testcase_02 AC 19 ms
8,552 KB
testcase_03 AC 20 ms
8,540 KB
testcase_04 AC 20 ms
8,644 KB
testcase_05 AC 19 ms
8,568 KB
testcase_06 AC 19 ms
8,664 KB
testcase_07 AC 19 ms
8,648 KB
testcase_08 AC 19 ms
8,512 KB
testcase_09 AC 23 ms
8,732 KB
testcase_10 AC 36 ms
9,336 KB
testcase_11 AC 24 ms
8,856 KB
testcase_12 AC 45 ms
9,780 KB
testcase_13 AC 22 ms
8,580 KB
testcase_14 AC 26 ms
9,052 KB
testcase_15 AC 33 ms
9,260 KB
testcase_16 AC 26 ms
8,924 KB
testcase_17 AC 75 ms
11,752 KB
testcase_18 AC 26 ms
8,972 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,430 ms
71,572 KB
testcase_28 AC 1,721 ms
94,136 KB
testcase_29 AC 68 ms
11,256 KB
testcase_30 AC 113 ms
13,780 KB
testcase_31 AC 278 ms
21,444 KB
testcase_32 AC 1,097 ms
60,016 KB
testcase_33 AC 50 ms
10,016 KB
testcase_34 AC 1,100 ms
59,800 KB
testcase_35 AC 20 ms
8,608 KB
testcase_36 AC 20 ms
8,684 KB
testcase_37 AC 1,103 ms
59,868 KB
testcase_38 AC 19 ms
8,624 KB
testcase_39 AC 1,096 ms
59,808 KB
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 AC 96 ms
19,208 KB
testcase_45 TLE -
testcase_46 TLE -
testcase_47 TLE -
testcase_48 AC 156 ms
26,008 KB
testcase_49 AC 143 ms
25,920 KB
testcase_50 AC 142 ms
24,900 KB
testcase_51 AC 20 ms
8,512 KB
testcase_52 TLE -
testcase_53 AC 543 ms
34,432 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