結果

問題 No.941 商とあまり
ユーザー maspy
提出日時 2019-12-04 12:53:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 526 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 11,760 KB
最終ジャッジ日時 2024-11-30 06:38:22
合計ジャッジ時間 7,669 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 4
other AC * 59 RE * 45
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,X,*A = map(int,read().split())

Aplus = [x + 1 for x in A]

p = 1
for x in Aplus:
    p *= x
    if p > X + 100:
        break
p -= 1

if p > X:
    answer = '0' * X
    print(answer)
    exit()

if any(x == 1 for x in A):
    if N == 1:
        answer = '1' + (X - 1)
    else:
        # p 以上が全部作れる
        answer = '0' * (p - 1) + '1' * (X - p + 1)
    print(answer)
    exit()

# RE
raise
0