Problem:


Score : 100 points

Problem Statement

You are given three integers A, B and C.
Determine whether C is not less than A and not greater than B.

Constraints

-100≤A,B,C≤100 

A, B and C are all integers.

Input

Input is given from Standard Input in the following format:  

A B C

Output

If the condition is satisfied, print Yes; otherwise, print No.

Sample Input 1

1 3 2

Sample Output 1

Yes

C=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.

Sample Input 2

6 5 4

Sample Output 2

No

C=4 is less than A=6, and thus the output should be No.

Sample Input 3

2 2 2

Sample Output 3

Yes



Sample input:
1 3 2


Sample output:
Yes

Submission status: Runtime Error

Solution code:
import numpy as np

n, m = map(int, raw_input().split())
g = []
for i in range(m):
    g.append(map(int, raw_input().split()))

graph = {}
for i in g:
    if i[0] not in graph:
        graph[i[0]] = [[i[1], i[2]]]
    else:
        graph[i[0]].append([i[1], i[2]])

table = np.zeros(n + 1) + 0.5
table[1] = 0
fp = [1]
for i in range(n):
    for k in fp:
        if k in graph.keys():
            for j in graph[k]:
                if table[j[0]] < table[k] + j[1]:
                    table[j[0]] = table[k] + j[1]
                    if j[0] != n and fp not in [j[0]]:
                        fp.append(j[0])
                if table[j[0]] == 0.5:
                    table[j[0]] = table[k] + j[1]
                    if j[0] != n:
                        fp.append(j[0])
max = int(table[n])
fp.append(n)
flag = 0
for i in range(3):
    for k in fp:
        if k in graph.keys():
            for j in graph[k]:
                if table[j[0]] < table[k] + j[1]:
                    table[j[0]] = table[k] + j[1]
                    fp.append(j[0])
                if table[j[0]] == 0.5:
                    table[j[0]] = table[k] + j[1]
                    if j[0] != n:
                        fp.append(j[0])
                if max < int(table[n]):
                    print"inf"
                    flag = 1
                    break
        if flag == 1:
            break

    if flag == 1:
        break
if flag != 1:
    print int(table[n])

Submission status: Runtime Error

Solution code:
import sys

v = map(int,raw_input().strip().split(" "))
n = 0;
k = 0;
i = 0;
for c in v:
	if i == 0:
		n = c
	elif i == 1:
		k = c

	i += 1

nums = []
sizes = []

for c in range(1,n):
	w = map(int,raw_input().strip().split(" "))
	x = 0
	for d in w:
		if x == 0:
			nums.insert(c-1,d)
		elif x == 1:
			sizes.insert(c-1,d)

		x += 1

	# print nums[c-1]
	# print sizes[c-1]

point = 0
for c in range(0,n):
	point += sizes[c]
	if point >= k:
		print nums[c]
		break

Submission status: Runtime Error

Solution code:
import sys

v = map(int,raw_input().strip().split(" "))
n = 0;
k = 0;
i = 0;
for c in v:
        if i == 0:
                n = c
        elif i == 1:
                k = c

        i += 1

nums = []
sizes = []

for c in range(1,n):
        w = map(int,raw_input().strip().split(" "))
        x = 0
        for d in w:
                if x == 0:
                        nums.insert(c-1,d)
                elif x == 1:
                        sizes.insert(c-1,d)

                x += 1

        # print nums[c-1]
        # print sizes[c-1]

point = 0
for c in range(0,n):
        point += sizes[c]
        if point >= k:
                print nums[c]
                break

Submission status: Runtime Error

Solution code:
nums = [int(x) for x in input().split()]
N = nums[0]
K = nums[1]
arr = []
for i in range(N):
	nums = [int(x) for x in input().split()]
	arr.append(tuple(nums))

arr = sorted(arr, key=lambda x: x[0])

vol = 0
for i in range(len(arr)):
	vol = vol + arr[i][1]
	if vol >= K:
		print(arr[i][0])
		break

Submission status: Runtime Error

Solution code:
int(a, b, c) = [(i) for i in input().split()]
if c >= a and c <= b:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
a, b, c = [(i) for i in int(input()).split()]
if c >= a and c <= b:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
N,M = map(int,raw_input().split())

W = [['inf' for j in range(N)] for i in range(N)]
y = ['inf' for i in range(N)]
y_t = ['inf' for i in range(N)]
y[0] = 0
y_t[0] = 0

for i in range(N):
    W[i][i]=0

for i in range(M):
    a,b,c=map(int,raw_input().split())
    W[a-1][b-1] = c

flag = False

for i in range(N):
    for j in range(N):
        yj_max = 'inf'
        for k in range(N):
            yj_temp = 'inf'
            if y[k]!='inf' and W[k][j]!='inf':
                yj_temp=y[k]+W[k][j]
            if yj_temp!='inf':
                if yj_temp=='inf':
                    yj_max = yj_temp
                elif yj_max<yj_temp:
                    yj_max = yj_temp
        y_t[j]=yj_max
    if y==y_t:
        flag = True
        break
    y = y_t
    

print y[N-1]

Submission status: Runtime Error

Solution code:
a, b, c = [(i) for i in int(input().split())]
if c >= a and c <= b:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
def flatten(nested_list):
    return [e for inner_list in nested_list for e in inner_list]
nk = input().split()
kai = int(nk[0])
banme = int(nk[1])
lis = []
i = 0
while(i < kai):
    c = input().split()
    a = int(c[0])
    b = int(c[1])
    n = 0
    tmplis = [a] * b
    lis.append(tmplis)
    print(lis)
    i += 1
    pass
lis = flatten(lis)
slis = sorted(lis)
ans = slis[banme]
print(ans)

Submission status: Runtime Error

Solution code:
N,M = map(int,raw_input().split())

road_list = [[] for i in range(N)]

W = [[-2*(10**9)-1 for j in range(N)] for i in range(N)]
y = [-2*(10**9)-1 for i in range(N)]
y_t = [-2*(10**9)-1 for i in range(N)]
y[0] = 0
y_t[0] = 0

for i in range(N):
    W[i][i]=0

for i in range(M):
    a,b,c=map(int,raw_input().split())
    W[a-1][b-1] = c

flag = False

for i in range(N):
    for j in range(N):
        yj_max = -2*(10**9)-1
        for k in range(N):
            yj_temp = -2*(10**9)-1
            if y[k]!=-2*(10**9)-1 and W[k][j]!=-2*(10**9)-1:
                yj_temp=y[k]+W[k][j]
            if yj_max<yj_temp:
                yj_max = yj_temp
        y_t[j]=yj_max
    if y==y_t:
        flag = True
        break
    y = y_t
    

if flag:
    print y[N-1]
else:
    print 'infty'

Submission status: Runtime Error

Solution code:
d={}
N,K=map(int,raw_input().split())

for i in xrange(N):
    a,b=map(int,raw_input().split())
#    print a,b
    if a in d:
        d[a] = d[a] + b
    else:
        d[a]=b
#    td={}
#    cnt=0
#    print d
#    for key in sorted(d):
#        print key
#        if cnt<=K:
#            td[key]=d[key]
#        else:
#            break
#    d=td

aa=None
cnt=0
#print d
for k in sorted(d):
    aa=k
    cnt+=d[k]
#    print cnt
    if cnt>=K:
        break
print aa

Submission status: Runtime Error

Solution code:
N = []
K = []
key_num, tmp = map(int, input().split())
x = 0
while x < key_num:
    a, b = map(int, input().split())
    N.append(a)
    K.append(b)
    x += 1
#print(N, K)
input_data = []
n = 0
for i in N:
    now = 1
    while now <= K[n]:
        input_data.append(i)
        now += 1
    n += 1
#print(input_data)
input_data.sort()
print(input_data[key_num])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
args = sys.argv

A = int(args[1])
B = int(args[2])
C = int(args[3])

#--------------------------
#比較処理
if C >= A and C <= B:
    print 'YES'
else:
    print 'NO'

return 0

Submission status: Runtime Error

Solution code:
N = []
K = []
while True:
    a, b = map(int, input().split())
    if a == -1:
        break
    N.append(a)
    K.append(b)
key = K[0]
del N[0]
del K[0]
print(N, K)
input_data = []
n = 0
for i in N:
    now = 1
    while now <= K[n]:
        input_data.append(i)
        now += 1
    n += 1
print(input_data)
input_data.sort()
print
print(input_data[key])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
args = sys.argv

A = int(args[1])
B = int(args[2])
C = int(args[3])

#--------------------------
#比較処理
if C >= A and C <= B:
    print 'YES'
else:
    print 'NO'

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import sys

args = sys.argv

A = int(args[1])
B = int(args[2])
C = int(args[3])

#--------------------------
#入力値のチェック処理
if A < -100 or A > 100:
    print A + u'は範囲外です'
    sys.exit()
if B < -100 or A > 100:
    print B + u'は範囲外です'
    sys.exit()
if C < -100 or C > 100:
    print C + u'は範囲外です'
    sys.exit()

#--------------------------
#比較処理
if C >= A and C <= B:
    print 'YES'
else:
    print 'NO'

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

x = input()
y=[]
y=x.split(" ")
N=int(y[0])
M=int(y[1])

z=[]
for i in range(M):
	temp1=input()
	temp2=temp1.split(" ")
	for j in temp2:
		j=int(j)
		z.append(j)

dict={}
for i in range(N):
	i+=1
	dict[i]=0

for i in z:
	dict[i]=dict[i]+1

for i in range(N):
	i+=1
	print(dict[i])

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
if (a =< c) and (c =< b):
    print('Yes')
    
else:
    print('No')

Submission status: Runtime Error

Solution code:
N, M = map(int, raw_input().split())
kotae = [0]*N
for i in range(M):
 l=map(int, raw_input().split())
 for j in range(len(l)):
  kotae[l[j]-1]=kotae[l[j]-1]+1

for k in range(N):
 print kotae[k]

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

# def flatten(nested_list):
#     return [e for inner_list in nested_list for e in inner_list]

N, K = map(int, raw_input().split())

a = [0] * N
b = [0] * N
ab = [[0, 0]] * N
for i in range(N):
    _a, _b = map(int, raw_input().split())
    ab[i] = [_a, _b]
ab.sort(key=lambda x:x[0])

j = 0
index = 0
while j < K:
    j += ab[index][1]
    if j < K:
        index += 1
print ab[index][0]

Submission status: Runtime Error

Solution code:
import sys
n,m = [int(x) for x in sys.stdin.readline().split()]
r = [0] * n
for i in range m:
	a, b = [int(x) for x in sys.stdin.readline().split()]
	r[a-1] += 1
	r[b-1] += 1
for i in range n:
	print(r[i])

Submission status: Runtime Error

Solution code:
i = int(input().split())
if (i[0] <= i[2]) and (i[1] >= i[2]):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
print((lambda a,b,c: "YES" if a<=c&&c<=b else "NO")(*[int(_) for _ in input().split()]))

Submission status: Runtime Error

Solution code:
a,b,c =map(int,input().split())
a,b,c =abc.split()

if c>=a and c<=b:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
i = int(input().split())
if (i[0] <= i[2]) && (i[1] >= i[2]):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
a, b, c = input()
if a <= c and c <= b:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
    a,b,c = map(int,input().split())
     
    if a <= b and b <= c:
     print ("Yes")
    else:
     print ("No")

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input(),split())

if a <= b and b <= c:
 print ("Yes")
else:
 print ("No")

Submission status: Runtime Error

Solution code:
a,b,c = [int(x) for x in input().split()]

if c>=a and c<=b:
	print("Yes")
else
	print("No")

Submission status: Runtime Error

Solution code:
import sys

stdin = sys.stdin


def na(): return map(int, stdin.readline().split())


def ns(): return stdin.readline().strip()


a,b,c = map(int, stdin.readlien().split())
if a <= c <= b:
    print("Yes")
else:
    print("No")