又看到这张图 这鸽子是被捏死了吧# Joke - 肚皮舞运动
w*k
1 楼
There are at most eight servers in a data center. Each server has got a
capacity/memory limit. There can be at most 8 tasks that need to be
scheduled on those servers. Each task requires certain capacity/memory to
run, and each server can handle multiple tasks as long as the capacity limit
is not hit. Write a program to see if all of the given tasks can be
scheduled or not on the servers?
Ex:
Servers capacity limits: 8, 16, 8, 32
Tasks capacity needs: 18, 4, 8, 4, 6, 6, 8, 8
For this example, the program should say 'true'.
Ex2:
Server capacity limits: 1, 3
Task capacity needs: 4
For this example, program should return false.
capacity/memory limit. There can be at most 8 tasks that need to be
scheduled on those servers. Each task requires certain capacity/memory to
run, and each server can handle multiple tasks as long as the capacity limit
is not hit. Write a program to see if all of the given tasks can be
scheduled or not on the servers?
Ex:
Servers capacity limits: 8, 16, 8, 32
Tasks capacity needs: 18, 4, 8, 4, 6, 6, 8, 8
For this example, the program should say 'true'.
Ex2:
Server capacity limits: 1, 3
Task capacity needs: 4
For this example, program should return false.