티스토리 뷰
문제출처 - https://www.acmicpc.net/problem/1748
1748번: 수 이어 쓰기 1
첫째 줄에 N(1≤N≤100,000,000)이 주어진다.
www.acmicpc.net
def solution(num):
sum = 0
length = len(num)
if length == 1: return int(num)
for i in range(length - 1):
sum += 9 * (10 ** i) * (i + 1)
sum += (int(num) - (10 ** (length - 1)) + 1) * length
return sum
num = input()
print(solution(num))'ALGORITHM > 백준' 카테고리의 다른 글
| [Python]백준 - 소트인사이드(1427번) (0) | 2020.02.23 |
|---|---|
| [Python]백준 - 보물섬(2589번) (0) | 2020.02.13 |
| [Python]백준 - 베르트랑 공준(4948번) (2) | 2020.02.11 |
| [Python]백준 - 명령 프롬포트(1032번) (0) | 2020.02.11 |
| [Java]백준 - 좌표 정렬하기(11650) (0) | 2019.12.10 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 해시
- 스택
- combination
- 힙
- 백준
- BOJ
- SW Expert
- dictionary
- 문자열처리
- 문자열
- 괄호
- SWExpert
- 2019 Kakao Blind Recruitment
- 구현
- 우선순위큐
- 프로그래머스
- hash
- 재귀
- 코딩테스트
- 완전탐색
- 순열
- Permutation
- 딕셔너리
- 정렬
- C++
- left join
- Python
- programmers
- 2020 KAKAO BLIND RECRUITMENT
- 파이썬
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함