일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파이썬 주식
- 즐겨찾기가 가장 많은 식당 정보 출력하기
- Web Service Architecture
- BigDecimal
- beautifulsoup
- spring
- JavaScript Obejct Notation
- java
- 리눅스
- WAS WebServer 차이
- 프로그래머스 소수
- pybithumb
- 파이썬
- 리눅스 rwx
- 파이썬 가상환경
- 빗썸 API 사용
- 변동성 돌파전략
- 프로그래머스
- JSON특징
- 리눅스 777
- WAS란
- Python
- string format
- 와스 웹서버의 차이
- Web Server란
- 프로그래머스 SQL
- JSON 형식
- 트레이딩 봇 만들기
- 오라클
- 단순 반복 자동화
- Today
- Total
IT 개발자_S
해커랭크 Breaking the Records 본문
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the breakingRecords function below.
def breakingRecords(scores):
hs = 0
ls =0
hs_count =0
ls_count =0
length = len(scores) -1
ls = scores[0]
hs = scores[0]
print(ls, hs)
for i in range(len(scores)) :
if( hs < scores[i]) :
hs = scores[i]
hs_count +=1
if(ls > scores[i]) :
ls =scores[i]
ls_count +=1
return hs_count, ls_count
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n = int(input())
scores = list(map(int, input().rstrip().split()))
result = breakingRecords(scores)
fptr.write(' '.join(map(str, result)))
fptr.write('\n')
fptr.close()
'IT > 알고리즘_Python' 카테고리의 다른 글
해커랭크 Picking Numbers (0) | 2020.03.29 |
---|---|
해커랭크 Brithday Chocolate (0) | 2020.03.22 |
해커랭크 Kangaroo PYTHON (0) | 2020.03.13 |
해커랭크 Apple and Orange (0) | 2020.03.12 |
해커랭크 Grading Strudents (0) | 2020.03.12 |