Submission #7469162


Source Code Expand

Copy
# ABC005C - おいしいたこ焼きの売り方
def main():
    T, N, *AMB = map(int, open(0).read().split())
    A, B, order = AMB[:N], AMB[N + 1 :], [0] * 201
    for i in B:
        order[i] += 1
    for i in A:
        for j in range(T + 1):
            if order[i + j]:  # assign to a person nearby
                order[i + j] -= 1
                break
    flg = sum(order) == 0
    print("yes" if flg else "no")


if __name__ == "__main__":
    main()

Submission Info

Submission Time
Task C - おいしいたこ焼きの売り方
User solzard
Language Python (3.4.3)
Score 100
Code Size 476 Byte
Status
Exec Time 17 ms
Memory 3064 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
× 35
Set Name Test Cases
All rand0.txt, rand1.txt, rand10.txt, rand11.txt, rand12.txt, rand13.txt, rand14.txt, rand15.txt, rand16.txt, rand17.txt, rand18.txt, rand19.txt, rand2.txt, rand20.txt, rand21.txt, rand22.txt, rand23.txt, rand24.txt, rand25.txt, rand26.txt, rand27.txt, rand28.txt, rand29.txt, rand3.txt, rand4.txt, rand5.txt, rand6.txt, rand7.txt, rand8.txt, rand9.txt, s1.txt, s2.txt, s3.txt, s4.txt, s5.txt
Case Name Status Exec Time Memory
rand0.txt 17 ms 3064 KB
rand1.txt 16 ms 3060 KB
rand10.txt 17 ms 3060 KB
rand11.txt 17 ms 3060 KB
rand12.txt 17 ms 3064 KB
rand13.txt 17 ms 3060 KB
rand14.txt 17 ms 3064 KB
rand15.txt 17 ms 3064 KB
rand16.txt 17 ms 3064 KB
rand17.txt 17 ms 3060 KB
rand18.txt 17 ms 3064 KB
rand19.txt 17 ms 3064 KB
rand2.txt 17 ms 3064 KB
rand20.txt 17 ms 3064 KB
rand21.txt 17 ms 3064 KB
rand22.txt 17 ms 3064 KB
rand23.txt 17 ms 3064 KB
rand24.txt 17 ms 3064 KB
rand25.txt 17 ms 3064 KB
rand26.txt 17 ms 3064 KB
rand27.txt 17 ms 3060 KB
rand28.txt 17 ms 3064 KB
rand29.txt 17 ms 3060 KB
rand3.txt 16 ms 3064 KB
rand4.txt 17 ms 3060 KB
rand5.txt 17 ms 3064 KB
rand6.txt 17 ms 3064 KB
rand7.txt 17 ms 3064 KB
rand8.txt 17 ms 3064 KB
rand9.txt 17 ms 3064 KB
s1.txt 16 ms 3060 KB
s2.txt 17 ms 3060 KB
s3.txt 17 ms 3064 KB
s4.txt 17 ms 3064 KB
s5.txt 17 ms 3064 KB