結果
問題 | No.1017 Reiwa Sequence |
ユーザー | lemondo |
提出日時 | 2020-12-23 10:36:54 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 889 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 81,640 KB |
実行使用メモリ | 140,164 KB |
最終ジャッジ日時 | 2023-10-21 15:04:32 |
合計ジャッジ時間 | 38,984 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
53,356 KB |
testcase_01 | AC | 39 ms
53,352 KB |
testcase_02 | AC | 39 ms
53,356 KB |
testcase_03 | WA | - |
testcase_04 | AC | 40 ms
53,356 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 40 ms
53,356 KB |
testcase_08 | AC | 41 ms
53,356 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 50 ms
62,312 KB |
testcase_15 | AC | 50 ms
64,356 KB |
testcase_16 | AC | 51 ms
62,312 KB |
testcase_17 | AC | 57 ms
69,836 KB |
testcase_18 | AC | 50 ms
62,312 KB |
testcase_19 | AC | 356 ms
140,160 KB |
testcase_20 | AC | 365 ms
140,164 KB |
testcase_21 | AC | 369 ms
140,156 KB |
testcase_22 | AC | 371 ms
140,160 KB |
testcase_23 | AC | 367 ms
140,160 KB |
testcase_24 | AC | 373 ms
140,156 KB |
testcase_25 | AC | 373 ms
140,156 KB |
testcase_26 | AC | 372 ms
140,160 KB |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 219 ms
101,332 KB |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
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 | 40 ms
53,356 KB |
testcase_52 | WA | - |
testcase_53 | WA | - |
ソースコード
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() As.sort() 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')