Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f35b434

Browse files
authored
Solution
1 parent 9b584c1 commit f35b434

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/python3
2+
3+
import math
4+
import os
5+
import random
6+
import re
7+
import sys
8+
9+
# Complete the countApplesAndOranges function below.
10+
def countApplesAndOranges(s, t, a, b, apples, oranges):
11+
acount = 0
12+
bcount = 0
13+
for i in range(len(apples)):
14+
temp = a+apples[i]
15+
if(temp in range(s,t+1)):
16+
acount+=1
17+
for i in range(len(oranges)):
18+
temp = b+oranges[i]
19+
if(temp in range(s,t+1)):
20+
bcount+=1
21+
print (acount)
22+
print (bcount)
23+
24+
25+
26+
if __name__ == '__main__':
27+
st = input().split()
28+
29+
s = int(st[0])
30+
31+
t = int(st[1])
32+
33+
ab = input().split()
34+
35+
a = int(ab[0])
36+
37+
b = int(ab[1])
38+
39+
mn = input().split()
40+
41+
m = int(mn[0])
42+
43+
n = int(mn[1])
44+
45+
apples = list(map(int, input().rstrip().split()))
46+
47+
oranges = list(map(int, input().rstrip().split()))
48+
49+
countApplesAndOranges(s, t, a, b, apples, oranges)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /