728x90
10886번
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번
n= int(input())
for i in range(1,10):
print(n,"*",i,"=",n*i)
2921번
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번
t=int(input())
for i in range(t):
a,b=map(int,input().split(','))
print(a+b)
15917번
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번
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번
while (1):
a,b = map(int,input().split())
if a==0 and b==0:
exit()
print(a+b)
4101번
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번
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번
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 |