Created
March 3, 2021 13:54
-
-
Save Shinoryo/bf2f369e0a6064f0d42e1ecf07081058 to your computer and use it in GitHub Desktop.
This is my code of Problem B of AtCoder Beginner Contest 191.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 入力 | |
N, X = [int(i) for i in input().split()] | |
A = [int(i) for i in input().split()] | |
# 配列A'を用意 | |
Aprime = [] | |
for i in range(N): | |
if A[i] != X: | |
Aprime.append(A[i]) | |
# 出力(A'が空白の場合を考慮) | |
if Aprime == []: | |
print() | |
else: | |
Aprimestr = "" | |
for i in range(len(Aprime)-1): | |
Aprimestr += str(Aprime[i]) + " " | |
Aprimestr += str(Aprime[-1]) | |
print(Aprimestr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment