Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Baekjoon Online Judge/11_月_November.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
a = int(input())
b = int(input())

if a + (7 * b) <= 30:
print(1)
else:
print(0)
9 changes: 9 additions & 0 deletions Baekjoon Online Judge/2023_은_무엇이_특별할까.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
count = int(input())

for _ in range(count):
number = int(input())
target = number + 1
if target % int(str(number)[-2:]) == 0:
print("Good")
else:
print("Bye")
15 changes: 15 additions & 0 deletions Baekjoon Online Judge/2033_년_밈_투표.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
PROMISES = [
"Never gonna give you up",
"Never gonna let you down",
"Never gonna run around and desert you",
"Never gonna make you cry",
"Never gonna say goodbye",
"Never gonna tell a lie and hurt you",
"Never gonna stop",
]

loop = int(input())
if all(input() in PROMISES for _ in range(loop)):
print("No")
else:
print("Yes")
9 changes: 9 additions & 0 deletions Baekjoon Online Judge/27323.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import math


def solution(number: int) -> int:
return math.factorial(number)


if __name__ == "__main__":
print(solution(number=int(input())))
8 changes: 8 additions & 0 deletions Baekjoon Online Judge/27866.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def solution(target_string: str, index_: int) -> str:
return target_string[index_ - 1]


if __name__ == "__main__":
target_string = input()
index_ = int(input())
print(solution(target_string, index_))
4 changes: 4 additions & 0 deletions Baekjoon Online Judge/2_桁の整数_Two_digit_Integer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a = int(input())
b = int(input())

print(a * 10 + b)
2 changes: 2 additions & 0 deletions Baekjoon Online Judge/AI_선도대학.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target_year = int(input())
print(target_year - 2024)
12 changes: 12 additions & 0 deletions Baekjoon Online Judge/A_B.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <iostream>

int sum(int A, int B) {
return A + B;
}

int main() {
int A, B;
std::cin >> A >> B;
std::cout << sum(A, B) << std::endl;
return 0;
}
7 changes: 7 additions & 0 deletions Baekjoon Online Judge/A_B.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def solution(a: int, b: int) -> int:
return a + b


a = int(input())
b = int(input())
print(solution(a, b))
11 changes: 11 additions & 0 deletions Baekjoon Online Judge/A_B_C_A_B_C.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def main(a, b, c):
print(a + b - c )
print(int(str(a) + str(b)) - c)


if __name__ == "__main__":
a = int(input())
b = int(input())
c = int(input())

main(a, b, c)
5 changes: 5 additions & 0 deletions Baekjoon Online Judge/Adding_Trouble.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
a, b, c = map(int, input().split())
if a + b == c:
print("correct!")
else:
print("wrong!")
5 changes: 5 additions & 0 deletions Baekjoon Online Judge/Affischutskicket.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
c4_g, a3_g, a4_g = map(int, input().split())
c4 = c4_g * 0.229 * 0.324
a3 = a3_g * 0.297 * 0.42
a4 = a4_g * 0.21 * 0.297
print(f"{2*c4 + 2*a3 + a4:.6f}")
6 changes: 6 additions & 0 deletions Baekjoon Online Judge/An_Easy_Peasy_Problem.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
solved_people, total_people = map(int, input().split())

if (solved_people / total_people) >= 0.5:
print("E")
else:
print("H")
12 changes: 12 additions & 0 deletions Baekjoon Online Judge/Andando_no_tempo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from itertools import combinations


a, b, c = map(int, input().split())


if a == b or a == c or b == c:
print("S")
elif a + b == c or a + c == b or b + c == a:
print("S")
else:
print("N")
6 changes: 6 additions & 0 deletions Baekjoon Online Judge/Another_Eruption.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from math import pi

a = int(input())
r = (a / pi) ** 0.5

print(f"{2 * pi * r:.9f}")
7 changes: 7 additions & 0 deletions Baekjoon Online Judge/Arno_s_Sleep_Schedule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sleep_time = int(input())
alarm_time = int(input())

if sleep_time in {0, 1, 2, 3}:
sleep_time += 24

print(abs(sleep_time - (alarm_time + 24)))
2 changes: 2 additions & 0 deletions Baekjoon Online Judge/Bank_Transfer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
k = int(input())
print(f"{max(100, min(2000, 25 + 0.01 * k)):.2f}")
20 changes: 20 additions & 0 deletions Baekjoon Online Judge/Basketball_One_on_One.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
input_ = input()

result = [''.join(x) for x in zip(input_[::2], input_[1::2])]

a = 0
b = 0

for ele in result:
if ele[0] == "A":
a += int(ele[1])
else:
b += int(ele[1])

if a >= 10 and b >= 10 and abs(a-b) >= 2:
break

if a > b:
print("A")
else:
print("B")
4 changes: 4 additions & 0 deletions Baekjoon Online Judge/Betting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a = int(input())

print(f"{((100 - a) / a) + 1:.10f}")
print(f"{((a / (100 - a)) + 1):.10f}")
16 changes: 16 additions & 0 deletions Baekjoon Online Judge/Betygsättning.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
a, c, e = map(int, input().split())
student_a, student_c, student_e = map(int, input().split())

if student_a == a and student_c == c and student_e == e:
print("A")
elif student_a >= a / 2 and student_c == c and student_e == e:
print("B")
elif student_c == c and student_e == e:
print("C")
elif student_c >= c / 2 and student_e == e:
print("D")
elif student_e == e:
print("E")
else:
raise ValueError("Invalid input")

17 changes: 17 additions & 0 deletions Baekjoon Online Judge/Bicycle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
a = int(input())
x = int(input())
b = int(input())
y = int(input())
t = int(input())

if t > 30:
option1 = a + (21 * (t - 30) * x)
else:
option1 = a

if t > 45:
option2 = b + (21 * (t - 45) * y)
else:
option2 = b

print(f"{option1} {option2}")
11 changes: 11 additions & 0 deletions Baekjoon Online Judge/Body_Mass_Index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
weight = float(input())
height = float(input())

bmi = weight / (height**2)

if bmi < 18.5:
print("Underweight")
elif 18.5 <= bmi <= 25:
print("Normal weight")
else:
print("Overweight")
5 changes: 5 additions & 0 deletions Baekjoon Online Judge/Call_for_Problems.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from collections import Counter

count = int(input())
counter = Counter(num % 2 == 1 for num in [int(input()) for _ in range(count)])
print(counter[True])
7 changes: 7 additions & 0 deletions Baekjoon Online Judge/Checkers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
a, b = map(int, input().split())

if a >= b:
print(b)
else:
if b != 0:
print(a + 1)
7 changes: 7 additions & 0 deletions Baekjoon Online Judge/Christmas_Tree_Adapter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
a = int(input())
w, v = map(int, input().split())

if w / v >= a:
print("1")
else:
print("0")
8 changes: 8 additions & 0 deletions Baekjoon Online Judge/Communication_Channels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
t = int(input())

for _ in range(t):
n, m = map(str, input().split())
if n == m:
print("OK")
else:
print("ERROR")
6 changes: 6 additions & 0 deletions Baekjoon Online Judge/Congruent_Numbers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
p_1, q_1, p_2, q_2 = map(int, input().split())
area = p_1 * p_2 / q_1 / q_2 / 2
if int(area) == area:
print(1)
else:
print(0)
5 changes: 5 additions & 0 deletions Baekjoon Online Judge/Conveyor_Belt_Sushi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
r = int(input())
g = int(input())
b = int(input())

print(r * 3 + g * 4 + b * 5)
5 changes: 5 additions & 0 deletions Baekjoon Online Judge/Counting_Antibodies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vk, jk = map(int, input().split())
vl, jl = map(int, input().split())
vh, dh, jh = map(int, input().split())

print(((vk * jk) + (vl * jl)) * (vh * dh * jh))
11 changes: 11 additions & 0 deletions Baekjoon Online Judge/Counting_Clauses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
m , n = map(int, input().split())

for _ in range(m):
list(map(int, input().split()))

if m >= 8:
print("satisfactory")
else:
print("unsatisfactory")


5 changes: 5 additions & 0 deletions Baekjoon Online Judge/Cutting_Corners.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
w, h = map(int, input().split())

diagonal = (w ** 2 + h ** 2) ** (1/2)

print(f"{w + h - diagonal:.9f}")
2 changes: 2 additions & 0 deletions Baekjoon Online Judge/DKSH_찾기.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target = input()
print(target.count("DKSH"))
7 changes: 7 additions & 0 deletions Baekjoon Online Judge/Divide_the_Cash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
n, d = map(int, input().split())
result = [int(input()) for _ in range(n)]

total = sum(result)

for ele in result:
print(int(ele / total * d))
20 changes: 20 additions & 0 deletions Baekjoon Online Judge/Easy_to_Solve_Expressions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from itertools import combinations

inputs = list(map(int, input().split()))

all_case_of_input = list(combinations(inputs, 2))


all_case_of_add = list(map(lambda x: x[0] + x[1], all_case_of_input))
all_case_of_mul = list(map(lambda x: x[0] * x[1], all_case_of_input))


for input_ in inputs:
if input_ in all_case_of_add:
print(1)
break
if input_ in all_case_of_mul:
print(2)
break
else:
print(3)
6 changes: 6 additions & 0 deletions Baekjoon Online Judge/Everyone_is_a_winner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
m, k = map(int, input().split())

if m % k == 0:
print("Yes")
else:
print("No")
5 changes: 5 additions & 0 deletions Baekjoon Online Judge/Final_Price.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
n = int(input())
initial_price = int(input())
price_variations = [int(input()) for _ in range(n - 1)]

print(initial_price + sum(price_variations))
6 changes: 6 additions & 0 deletions Baekjoon Online Judge/Football_Team.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import sys

translation = str.maketrans({"i": "e", "e": "i", "I": "E", "E": "I"})

for line in sys.stdin:
print(line.rstrip("\n").translate(translation))
13 changes: 13 additions & 0 deletions Baekjoon Online Judge/Goodbye_Code_Jam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
loop = int(input())

for i in range(1, loop + 1):
rank = int(input())

if rank > 4500:
print(f"Case #{i}: Round 1")
elif rank > 1000:
print(f"Case #{i}: Round 2")
elif rank > 25:
print(f"Case #{i}: Round 3")
else:
print(f"Case #{i}: World Finals")
5 changes: 5 additions & 0 deletions Baekjoon Online Judge/Greetings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
n = input()

e_count = n.count("e")

print("h" + "e" * e_count * 2 + "y")
6 changes: 6 additions & 0 deletions Baekjoon Online Judge/HI_ARC.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def solution(h: int, i: int, a: int, r: int, c: int) -> int:
return h * i - a * r * c


h, i, a, r, c = list(map(int, input().split()))
print(solution(h, i, a, r, c))
22 changes: 22 additions & 0 deletions Baekjoon Online Judge/IT_Passport_Examination.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
STRATEGY_PASS_SCORE = 35
MANAGEMENT_PASS_SCORE = 25
TECHNOLOGY_PASS_SCORE = 40


n = int(input())

for _ in range(n):
identity_number, strategy_score, management_score, technology_score = map(
int, input().split()
)
total_score = strategy_score + management_score + technology_score

pass_condition = (
total_score >= 55
and strategy_score / STRATEGY_PASS_SCORE >= 0.3
and management_score / MANAGEMENT_PASS_SCORE >= 0.3
and technology_score / TECHNOLOGY_PASS_SCORE >= 0.3
)
result = "PASS" if pass_condition else "FAIL"

print(f"{identity_number} {total_score} {result}")
Loading