일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Python
- 2935
- datetime
- 파이썬
- 11557
- 10162
- 5717
- Baekjoon
- MAX
- 2530
- 2163
- 2061
- itertools
- 2914
- 5063
- BaekjoonOnlineJudge
- Python3
- combinations
- 약수
- 암호
- 소수
- math
- kriii
- 4101
- 10214
- 2558
- 10886
- 9610
- 5355
- 백준
- Today
- Total
목록Python (62)
new!dea
www.acmicpc.net/problem/9498 9498번: 시험 성적 시험 점수를 입력받아 90 ~ 100점은 A, 80 ~ 89점은 B, 70 ~ 79점은 C, 60 ~ 69점은 D, 나머지 점수는 F를 출력하는 프로그램을 작성하시오. www.acmicpc.net #9498 시험 성적 (Python3) 1234567891011a = int(input())if a >= 90: print('A')elif a >= 80: print('B')elif a >= 70: print('C')elif a >= 60: print('D')else: print('F')cs 또는 1print('FFFFFFDCBAA'[int(input())//10])cs
www.acmicpc.net/problem/2935 2935번: 소음 수업 시간에 떠드는 두 학생이 있다. 두 학생은 수업에 집중하는 대신에 글로벌 경제 위기에 대해서 토론하고 있었다. 토론이 점점 과열되면서 두 학생은 목소리를 높였고, 결국 선생님은 크게 www.acmicpc.net #2935 소음 (Python3) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 a = input() b = input() c = input() if b == '+': d = len(a) - len(c) if d == 0: print('2'+a[1:]) elif d > 0: print(a[:d]+c) else: d = -d print(c[:d]+a) elif b == '*': print(a+c[1:]) cs 또..
www.acmicpc.net/problem/2675 2675번: 문자열 반복 문자열 S를 입력받은 후에, 각 문자를 R번 반복해 새 문자열 P를 만든 후 출력하는 프로그램을 작성하시오. 즉, 첫 번째 문자를 R번 반복하고, 두 번째 문자를 R번 반복하는 식으로 P를 만들면 된다 www.acmicpc.net #2675 문자열 반복 (Python3) 123456T = int(input())for i in range(T): R, S = input().split() for j in S: print(j * int(R), end='') print()cs
www.acmicpc.net/problem/5355 5355번: 화성 수학 겨울 방학에 달에 다녀온 상근이는 여름 방학 때는 화성에 갔다 올 예정이다. (3996번) 화성에서는 지구와는 조금 다른 연산자 @, %, #을 사용한다. @는 3을 곱하고, %는 5를 더하며, #는 7을 빼는 연산 www.acmicpc.net #5355 화성 수학 (Python3) 123456789101112T = int(input())for i in range(T): li = input().split() a = float(li[0]) for j in li[1:]: if j == '@': a *= 3 elif j == '%': a += 5 elif j == '#': a -= 7 print(f'{a:0.2f}')cs
www.acmicpc.net/problem/2914 2914번: 저작권 창영이는 노래 여러 개를 이어서 부르는 가수이다. 유명한 노래의 비슷한 멜로디를 이어서 부르면서 언제 곡이 넘어갔는지 모르게 만드는 것이 창영이 노래의 특징이다. 이런 노래로 상업적으 www.acmicpc.net #2914 저작권 (Python3) B = (멜로디 개수) 일 경우, $$I-1I-1$$ $$B>A\left ( I-1 \right )$$ $$B\geq A\left ( I-1 \right )+1$$ 12A, I = map(int, input().split())print(A * (I-1) + 1)cs
www.acmicpc.net/problem/2530 2530번: 인공지능 시계 첫째 줄에 종료되는 시각의 시, 분, 초을 공백을 사이에 두고 출력한다. (단, 시는 0부터 23까지의 정수이며, 분, 초는 0부터 59까지의 정수이다. 디지털 시계는 23시 59분 59초에서 1초가 지나면 0시 0 www.acmicpc.net #2530 인공지능 시계 (Python3) 123456from datetime import datetimefrom datetime import timedeltaa, b, c = map(int, input().split())d = int(input())e = datetime(2000,1,1,a,b,c) + timedelta(seconds=d)print(e.hour, e.minute, e...
www.acmicpc.net/problem/2525 2525번: 오븐 시계 첫째 줄에 종료되는 시각의 시와 분을 공백을 사이에 두고 출력한다. (단, 시는 0부터 23까지의 정수, 분은 0부터 59까지의 정수이다. 디지털 시계는 23시 59분에서 1분이 지나면 0시 0분이 된다.) www.acmicpc.net #2525 오븐 시계 (Python3) 123456from datetime import datetimefrom datetime import timedeltaa, b = map(int, input().split())c = int(input())d = datetime(2000,1,1,a,b) + timedelta(minutes=c)print(d.hour, d.minute)cs
www.acmicpc.net/problem/10699 10699번: 오늘 날짜 서울의 오늘 날짜를 출력하는 프로그램을 작성하시오. www.acmicpc.net #10699 오늘 날짜 (Python3) 1 2 3 4 from datetime import datetime from datetime import timedelta d = datetime.today() + timedelta(hours=9) print(d.strftime('%Y-%m-%d')) cs 채점 서버는 UTC+0이고, 서울은 UTC+9이기 때문에 9시간을 더해야 한다. 그런데 예를 들어 서울 기준 오늘 날짜가 2000년 1월 1일이라면 1 print('2000-01-01') cs 사실 이렇게 해도 통과된다.
www.acmicpc.net/problem/11022 11022번: A+B - 8 각 테스트 케이스마다 "Case #x: A + B = C" 형식으로 출력한다. x는 테스트 케이스 번호이고 1부터 시작하며, C는 A+B이다. www.acmicpc.net #11022 A+B - 8 (Python3) 1234T = int(input())for i in range(T): A, B = map(int, input().split()) print(f'Case #{i+1}: {A} + {B} = {A+B}')cs
www.acmicpc.net/problem/11021 11021번: A+B - 7 각 테스트 케이스마다 "Case #x: "를 출력한 다음, A+B를 출력한다. 테스트 케이스 번호는 1부터 시작한다. www.acmicpc.net #11021 A+B - 7 (Python3) 1234T = int(input())for i in range(T): A, B = map(int, input().split()) print(f'Case #{i+1}: {A+B}')cs