python-algorithm

백준 4775 Spelling Be

무적김두칠 2024. 12. 3. 22:11

https://www.acmicpc.net/problem/4775

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if __name__ == '__main__':
    num_word = int(input())
 
    word_dict = {}
    cnt = 1
    #word_dict = [input() for i in range(n)]
    for i in range(num_word):
        word_dict[input()] = 1
    n = int(input())
    for i in range(1, n+1):
        not_exist = []
        while True:
            s = input()
 
            if s == "-1":
                break
            if s not in word_dict:
                not_exist.append(s)
 
        if not_exist:
            print(f"Email {i} is not spelled correctly.")
            for word in not_exist:
                print(word)
        else:
            print(f"Email {i} is spelled correctly.")
    print("End of Output")
cs

내가 영어를 잘 못하나.. 해석이 어렵네요

반응형