Problem: Kizahashi, who was appointed as the administrator of ABC at National Problem Workshop in the Kingdom of AtCoder, got too excited and took on too many jobs.  Let the current time be time 0. Kizahashi has N jobs numbered 1 to N.  It takes A_i units of time for Kizahashi to complete Job i. The deadline for Job i is time B_i, and he must complete the job before or at this time.  Kizahashi cannot work on two or more jobs simultaneously, but when he completes a job, he can start working on another immediately.  Can Kizahashi complete all the jobs in time? If he can, print `Yes`; if he cannot, print `No`.

Submission attempts (in order):
import numpy as np

n = int(input())
ab = [int(input())for _ in range(n)]

ab.sort(reverse=True, key=lambda x: x[1])

ab = np.array(ab)
memo = ab.sum(axis=0)[0]
f = False  # flag

for x in ab:
    if memo <= x[1]:
        memo -= x[0]
    else:
        f = True
        break
if f:
    print("No")
else:
    print("Yes")


# coding: utf-8
import sys

# import math
import numpy as np


"""Template"""


class IP:
    
    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        
        return int(self.input())

    def S(self):
        
        return self.input()

    def IL(self):
        
        return list(map(int, self.input().split()))

    def SL(self):
        
        return list(map(str, self.input().split()))

    def ILS(self, n):
        
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        
        
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        
        return -(-x//y)

    def ave(self, a):
        
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)





def main():
    
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    
    n = ip.I()
    ab = ip.SILS(n)
    id.S(ab, 1, 1)
    ab = np.array(ab)
    memo = ab.sum(axis=0)[0]
    res = memo
    f = False
    for i, x in e(ab):
        if res <= x[1]:
            res -= x[0]
        else:
            f = True
            break
    if f:
        print("No")
    else:
        print("Yes")


main()


Verdicts: Runtime Error

Accepted