일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- JavaScript Obejct Notation
- 변동성 돌파전략
- 빗썸 API 사용
- Web Server란
- 파이썬 주식
- java
- 즐겨찾기가 가장 많은 식당 정보 출력하기
- 프로그래머스 SQL
- JSON 형식
- spring
- 파이썬 가상환경
- BigDecimal
- string format
- 파이썬
- 리눅스
- 와스 웹서버의 차이
- JSON특징
- pybithumb
- Python
- beautifulsoup
- Web Service Architecture
- 리눅스 rwx
- 프로그래머스
- WAS란
- 오라클
- WAS WebServer 차이
- 프로그래머스 소수
- 리눅스 777
- 단순 반복 자동화
- 트레이딩 봇 만들기
- Today
- Total
IT 개발자_S
해커랭크 Apple and Orange 본문
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the countApplesAndOranges function below.
def countApplesAndOranges(s, t, a, b, apples, oranges):
arrA =[]
resultA =0
arrO =[]
resultB =0
for i in range(len(apples)):
arrA.append(a + apples[i])
if(arrA[i] >= s and arrA[i] <=t): ## 파이썬 && and 조건
resultA +=1
for i in range(len(oranges)):
arrO.append(b + oranges[i])
if(arrO[i] >= s and arrO[i] <=t):
resultB +=1
print(resultA)
print(resultB)
if __name__ == '__main__':
st = input().split()
s = int(st[0])
t = int(st[1])
ab = input().split()
a = int(ab[0])
b = int(ab[1])
mn = input().split()
m = int(mn[0])
n = int(mn[1])
apples = list(map(int, input().rstrip().split()))
oranges = list(map(int, input().rstrip().split()))
countApplesAndOranges(s, t, a, b, apples, oranges)
'IT > 알고리즘_Python' 카테고리의 다른 글
해커랭크 Breaking the Records (0) | 2020.03.22 |
---|---|
해커랭크 Kangaroo PYTHON (0) | 2020.03.13 |
해커랭크 Grading Strudents (0) | 2020.03.12 |
해커랭크 TIME Conversion python (0) | 2020.03.12 |
해커랭크 Birthday Cake Candles (0) | 2020.03.10 |