10886번
10886번: 0 = not cute / 1 = cute
준희는 자기가 팀에서 귀여움을 담당하고 있다고 생각한다. 하지만 연수가 볼 때 그 의견은 뭔가 좀 잘못된 것 같았다. 그렇기에 설문조사를 하여 준희가 귀여운지 아닌지 알아보기로 했다.
www.acmicpc.net
cute=0
notcute=0
for i in range(int(input())):
yesorno = int(input())
if yesorno == 1:
cute+=1
elif yesorno == 0:
notcute+=1
if cute>notcute:
print("Junhee is cute!")
else:
print("Junhee is not cute!")
2739번
2739번: 구구단
N을 입력받은 뒤, 구구단 N단을 출력하는 프로그램을 작성하시오. 출력 형식에 맞춰서 출력하면 된다.
www.acmicpc.net
n= int(input())
for i in range(1,10):
print(n,"*",i,"=",n*i)
2921번
2921번: 도미노
도미노는 여러 종류의 타일 게임에서 사용하는 조각이다. 도미노 조각은 두 칸으로 이루어져 있다. 각 칸에는 점이 찍혀있는데, 점이 안 찍혀져 있을 수도 있다. 점의 개수는 세트의 크기에 의
www.acmicpc.net
n= int(input())
point_sum = 0
for x in range(n+1):
for y in range(x,n+1):
point_sum+=(y+x)
print(point_sum)
2중 for문 사용 !
10953번
10953번: A+B - 6
두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오.
www.acmicpc.net
t=int(input())
for i in range(t):
a,b=map(int,input().split(','))
print(a+b)
15917번
15917번: 노솔브 방지문제야!!
어떤 수 a가 2의 거듭제곱꼴로 나타내어진다고 해 봅시다. 그렇다면, a = 2n (단 n ≥ 0인 정수) 를 만족할 겁니다. 보통, 각 비트별로 검사를 하면서, 켜져 있는 비트의 개수를 알아내는 것도 좋은
www.acmicpc.net
import sys
q = int(sys.stdin.readline())
arr=[2**i for i in range(31)]
num=[int(sys.stdin.readline()) for i in range(0,q)]
for i in range(0,q):
if num[i] in arr :
print("1")
else:
print("0")
import sys .. 를 더 많이 쓰는 연습을 해야겠다 ~~ !
11006번
11006번: 남욱이의 닭장
계란집을 운영하는 남욱이는 매일 닭장에서 달걀을 수거해간다. 어느 날 닭장에 들어가보니 일부 닭의 다리가 하나씩 사라졌다. 남욱이는 얼마나 많은 닭들이 한 다리를 잃었는지 알고싶었
www.acmicpc.net
t = int(input())
for _ in range(t):
n,m = map(int,input().split())
t = n-m
u = 2*m - n
print(u,t)
t,u를 n,m으로만 나타낼 수 있는 계산을 한 뒤, 컴퓨터에게 넘겨준다 !
10952번
10952번: A+B - 5
두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오.
www.acmicpc.net
while (1):
a,b = map(int,input().split())
if a==0 and b==0:
exit()
print(a+b)
4101번
4101번: 크냐?
입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스는 한 줄로 이루어져 있으며, 두 정수가 주어진다. 두 수는 백만보다 작거나 같은 양의 정수이다. 입력의 마지막 줄에는 0이
www.acmicpc.net
while(1):
a,b = map(int,input().split())
if a==0 and b==0:
exit()
else:
if a>b:
print("Yes")
else:
print("No")
12756번
12756번: 고급 여관
플레이어 A의 카드가 남아있다면 "PLAYER A"를, 플레이어 B의 카드가 남아있다면 "PLAYER B"를 출력한다. 모두 죽은 상태라면 "DRAW"를 따옴표 없이 출력한다.
www.acmicpc.net
attack_a, heal_a =map(int,input().split())
attack_b, heal_b = map(int,input().split())
while(1):
if heal_a>0 and heal_b>0:
heal_b -= attack_a
heal_a -= attack_b
elif heal_a <=0 and heal_b<=0:
print("DRAW")
break
elif heal_a<=0 and heal_b>0:
print("PLAYER B")
break
elif heal_b<=0 and heal_a>0:
print("PLAYER A")
break
14579번
14579번: 덧셈과 곱셈
첫째 줄에 a, b (1 ≤ a < b ≤ 1000)가 주어진다.
www.acmicpc.net
a, b =map(int,input().split())
ans =1
def sigma(n):
cnt=0
for i in range(n+1):
cnt+=i
return cnt
for i in range(a,b+1,1):
ans *= sigma(i)
print(ans % 14579)
등수 : 17758 -> 16657
solved.ac를 드디어 연결했다 등수가 바로바로 눈에 보여서 재밌는 듯
풀이 중 개인적으로 조금 어려운 문제는 따로 하나씩 포스팅해 볼 예정이다.
'[알고리즘] > BOJ' 카테고리의 다른 글
[백준/Python] 기초 10제 - Day4 (0) | 2023.02.16 |
---|---|
[백준/Python] 기초 10제 - Day3 (0) | 2023.02.14 |
[백준/Python] 기초 10문제 - Day 1 (0) | 2023.02.08 |
[백준/python] 11286번 절댓값 힙 (0) | 2023.02.02 |
[백준/Python] 2753 윤년 (0) | 2022.09.05 |