python-algorithm

백준 26264 빅데이터? 정보보호!

무적김두칠 2022. 12. 30. 15:40

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

 

26264번: 빅데이터? 정보보호!

첫 번째 줄에 정보보호 분야보다 빅데이터 분야에 관심이 있는 학생이 더 많으면 "bigdata?"를, 빅데이터 분야보다 정보보호 분야에 관심이 있는 학생이 더 많으면 "security!"를, 같으면 "bigdata? securit

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
def sol(s):
    cnt_security = s.count('security')
    cnt_bigdata= s.count('bigdata')
    if cnt_security>cnt_bigdata:
        return 'security!'
    elif cnt_security<cnt_bigdata:
        return 'bigdata?'
    else:
        return 'bigdata? security!'
 
if __name__ == '__main__':
    n = int(input())
    s = input()
    print(sol(s))
cs
반응형