반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 검색트리
- SQL
- CSS
- 코딩테스트
- 정렬
- javascript
- codecademy
- SWEA
- 해슁
- CleanCode
- 순환
- 클린코드
- 프로그래머스
- 다이나믹 프로그래밍
- 구현
- BFS
- DP
- java
- Web
- Kotlin
- 자바
- html
- algorithm
- inflearn
- 알고리즘
- DFS
- front-end
- Color
- Spring
- android
Archives
- Today
- Total
깡뇽
[백준] 202999번 3대 측정 파이썬 본문
반응형
202999번 3대 측정 파이썬 풀이
[시도1] pypy3 출력 초과
n, k, l = map(int, input().split())
arr = [list(map(int, input().split())) for _ in range(n)]
count = 0
cnt = ''
for i in range(0, n):
sum = 0
sum = arr[i][0] + arr[i][1] + arr[i][2]
if sum >= k and arr[i][0] >= l and arr[i][1] >= l and arr[i][2] >= l :
count = count + 1
cnt = cnt + str(i)
print(count)
for i in range(0,len(cnt)):
for j in range(0,3):
print(arr[int(cnt[i])][j] , end = ' ')
[시도2] python3 시간 초과 (코드는 시도1과 동일 python3은 정답이 나오는지 해봄)
n, k, l = map(int, input().split())
arr = [list(map(int, input().split())) for _ in range(n)]
count = 0
cnt = ''
for i in range(0, n):
sum = 0
sum = arr[i][0] + arr[i][1] + arr[i][2]
if sum >= k and arr[i][0] >= l and arr[i][1] >= l and arr[i][2] >= l :
count = count + 1
cnt = cnt + str(i)
print(count)
for i in range(0,len(cnt)):
for j in range(0,3):
print(arr[int(cnt[i])][j] , end = ' ')
=> 좀 더 효율적으로 코드를 작성하는 방식을 생각해봐야한다.
20299번: 3대 측정
첫째 줄에 정수 $N$, $K$, $L$이 주어진다. $N$은 팀의 수, $K$는 팀원 $3$명의 레이팅 합에 대한 클럽 가입 조건, $L$은 개인 레이팅에 대한 클럽 가입 조건이다. ($1 \leq N \leq 500\ 000$, $0 \leq K \leq 12\ 000$, $
www.acmicpc.net
반응형
'Algorithm > BAEKJOON' 카테고리의 다른 글
[백준] 11650번 좌표 정렬하기 파이썬 (0) | 2022.01.28 |
---|---|
[백준] 2941번 크로아티아 알파벳 파이썬 (0) | 2022.01.26 |
[백준] 2751번 수 정렬하기 2 파이썬 (0) | 2022.01.26 |
[백준] 2845번 파티가 끝나고 난 뒤 파이썬 (0) | 2022.01.09 |
[백준] 20361번 일우는 야바위꾼 파이썬 (2) | 2021.02.16 |