Skip to main content
added 369 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 7 bytes

÷Ċ⁵x"ZẎ

A full program that accepts timesTimes quantumQuantum processesProcessIds and prints the schedule.

Try it online!

How?

÷Ċ⁵x"ZẎ - Main Link: Times, Quantum
÷       - {Times} divided by {Quantum}
 Ċ      - ceiling -> {SlotCounts}
  ⁵     - program's third argument -> ProcessIds
    "   - {ProcessIds} zip {SlotCounts} with:
   x    -   {ProcessId} times {SlotCount}
     Z  - transpose
      Ẏ - tighten
        - implicit print

Jelly, 7 bytes

÷Ċ⁵x"ZẎ

A full program that accepts times quantum processes and prints the schedule.

Try it online!

Jelly, 7 bytes

÷Ċ⁵x"ZẎ

A full program that accepts Times Quantum ProcessIds and prints the schedule.

Try it online!

How?

÷Ċ⁵x"ZẎ - Main Link: Times, Quantum
÷       - {Times} divided by {Quantum}
 Ċ      - ceiling -> {SlotCounts}
  ⁵     - program's third argument -> ProcessIds
    "   - {ProcessIds} zip {SlotCounts} with:
   x    -   {ProcessId} times {SlotCount}
     Z  - transpose
      Ẏ - tighten
        - implicit print
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 7 bytes

÷Ċ⁵x"ZẎ

A full program that accepts times quantum processes and prints the schedule.

Try it online!