Skip to content

Instantly share code, notes, and snippets.

@Shinoryo
Created February 12, 2021 17:36
This is my code of Problem C of AtCoder Beginner Contest 187.
# 入力
N = int(input())
# listではなくset
Slist = {input() for _ in range(N)}
# Slistに含まれる文字列を全探索
for searchword in Slist:
# !を付けたものがSlistに存在するなら、searchwordを出力し終了
if "!"+searchword in Slist:
print(searchword)
exit()
# 求めるものがなければsatisfiableを出力
print("satisfiable")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment