본문 바로가기

백준1054

백준 30979 유치원생 파댕이 돌보기 https://www.acmicpc.net/problem/30979 12345678910111213def sol(t, candys):    if t > candys:        return "Padaeng_i Cry"    else:        return "Padaeng_i Happy"  if __name__ == '__main__':    t = int(input())    n = int(input())    candys = sum(list(map(int, input().split())))    print(sol(t, candys)) Colored by Color Scriptercs 2024. 6. 19.
백준 27736 찬반투표 https://www.acmicpc.net/problem/27736 27736번: 찬반투표 투표가 통과되었으면 APPROVED, 통과되지 않았으면 REJECTED, 무효 처리되었으면 INVALID를 출력한다. www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 from math import ceil def sol(nums): if nums.count(0) >= ceil(len(nums)/2): return 'INVALID' elif sum(nums) 재학생절반 2.5명인데 3명으로 간주해야할 듯 싶어요 2024. 4. 21.
백준 31668 특별한 가지 https://www.acmicpc.net/problem/31668 31668번: 특별한 가지 첫 번째 줄에 파묻튀밥 한 줄에 들어가는 파묻튀의 양을 나타내는 정수 $N$이 주어진다. 두 번째 줄에 학교가 파묻튀를 사용한 양을 나타내는 정수 $M$이 주어진다. 세 번째 줄에 파묻튀밥 한 줄에 www.acmicpc.net 1234567891011def sol(n, m, k): answer = (m // n) * k return answer if __name__ == '__main__': n = int(input()) m = int(input()) k = int(input()) print(sol(n, m, k)) cs 2024. 4. 19.
백준 31428 엘리스 트랙 매칭 https://www.acmicpc.net/problem/31428 31428번: 엘리스 트랙 매칭 엘리스 트랙은 2020년부터 시작한 KDT(K-Digital Training) 교육이며 Cloud 트랙, SW 엔지니어 트랙, IOT 트랙, AI 트랙 총 4가지 트랙이 있다. 누적 1000명 이상의 수료생을 배출하였고, 현업에서 활동하는 많 www.acmicpc.net 123456if __name__ == '__main__': n = int(input()) friends = input().split() hello = input() print(friends.count(hello)) Colored by Color Scriptercs 2024. 4. 19.
백준 31520 Champernowne Verification https://www.acmicpc.net/problem/31520 31520번: Champernowne Verification The $k^{\text{th}}$ Champernowne word is obtained by writing down the first $k$ positive integers and concatenating them together. For example, the $10^{\text{th}}$ Champernowne word is $12345678910$. Given a positive integer $n$, determine if it is a Cham www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 def s.. 2024. 4. 18.
백준 30501 관공... 어찌하여 목만 오셨소... https://www.acmicpc.net/problem/30501 30501번: 관공... 어찌하여 목만 오셨소... 천하제일의 장수 관우도 결국 죽음을 맞이했다. 유비와 장비는 관우의 복수를 위해 $N$명의 용의자 중 관우를 죽인 범인을 찾으려 한다. 관우와 함께 있었던 장수의 말에 따르면 관우를 죽인 범 www.acmicpc.net 1234567if __name__ == '__main__': t = int(input()) for i in range(t): name = input() if 'S' in name: print(name) breakcs 2024. 4. 18.
백준 31090 2023은 무엇이 특별할까? https://www.acmicpc.net/problem/31090 31090번: 2023은 무엇이 특별할까? 각 테스트 케이스에 대해, $N+1$이 $N$의 끝 두 자리로 나누어 떨어진다면 Good을, 그렇지 않다면 Bye를 한 줄에 하나씩 차례로 출력하여라. www.acmicpc.net 12345678910111213141516def sol(yy): last_number = int(yy[:-3:-1][::-1]) if (int(yy) + 1) % last_number == 0: return 'Good' else: return 'Bye' if __name__ == '__main__': t = int(input()) for i in range(t): yy = input() print(sol(yy)) Co.. 2024. 4. 18.
백준 24087 アイスクリーム (Ice Cream) https://www.acmicpc.net/problem/24087 24087번: アイスクリーム (Ice Cream) JOI アイスクリーム店は,非常に高さのあるアイスクリームタワーが名物のアイスクリーム店である.アイスクリームタワーとは,ベースとなるアイスクリームの上に,追加のアイスクリーム www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 from math import ceil def sol(s, a, b): answer = 250 cost = 100 if s 2024. 4. 18.
백준 28290 안밖? 밖안? 계단? 역계단? https://www.acmicpc.net/problem/28290 28290번: 안밖? 밖안? 계단? 역계단? 길이가 8인 문자열 $S$가 주어진다. 문자열 $S$는 각 문자 a, s, d, f, j, k, l, ;가 정확히 한 번씩 등장한다. www.acmicpc.net 12345678910111213141516def sol(s): if s == 'fdsajkl;' or s == 'jkl;fdsa': return 'in-out' elif s == 'asdf;lkj' or s == ';lkjasdf': return 'out-in' elif s == 'asdfjkl;' : return 'stairs' elif s == ';lkjfdsa' : return 'reverse' else: return 'molu.. 2024. 4. 17.
백준 31495 그게 무슨 코드니.. https://www.acmicpc.net/problem/31495 31495번: 그게 무슨 코드니.. 첫 번째 줄에 토카의 문자열을 뜻하는 문자열 $S$가 주어진다. $S$는 $50$글자를 넘지 않으며, 영어 대소문자와 큰따옴표, 그리고 공백으로 이루어져 있다. 큰따옴표는 전체 문자열에서 $2$개 이하 www.acmicpc.net 123456789101112def sol(s): if s == '"' or s == '""': return 'CE' elif s.startswith('"') and s.endswith('"'): return s.replace('"', '') else: return 'CE' if __name__ == '__main__': s = input() print(sol(s))cs 2024. 4. 16.
백준 30999 민주주의 https://www.acmicpc.net/problem/30999 30999번: 민주주의 월간 향유회에서는 민주주의적 다수결 투표 방식으로 문제의 출제 여부를 정한다. 즉, $N$개의 문제 후보마다 $M$명의 출제위원이 찬반 의견을 내고, 과반수의 찬성을 얻은 문제가 출제된다. 이때 www.acmicpc.net 1 2 3 4 5 6 7 8 if __name__ == '__main__': n, m = map(int, input().split()) answer = 0 for i in range(n): s = input() if s.count('O') > m//2: answer += 1 print(answer) cs 2024. 4. 16.
백준 31403 https://www.acmicpc.net/problem/31403 31403번: $A + B - C$ JavaScript에서 $+, -$은 수에 대해서는 일반적인 의미의 덧셈 뺄셈의 의미를 가지고 있습니다. 하지만 문자열에 대해서 $+$는 두 문자열을 이어붙이라는 의미이고, $-$는 양쪽 문자열을 수로 해석한 www.acmicpc.net 12345678910def sol(a, b, c): print(int(a) + int(b) - int(c)) print(int(a+b) - int(c)) if __name__ == '__main__': a = input() b = input() c = input() sol(a, b, c)cs 2024. 4. 16.