Submission
Id | When | Author | Problem | Language | CPU | Memory | Verdict |
---|---|---|---|---|---|---|---|
16861 | 2024-04-19 14:27:10 | dnt | Shift the liquid | Java | 108 ms | 42328 kb | Accepted |
Test Cases
CPU | Memory | Verdict | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
1 | 105 ms | 38680 kb | Accepted | ||||||||
2 | 108 ms | 38700 kb | Accepted | ||||||||
3 | 104 ms | 42328 kb | Accepted | ||||||||
4 | 104 ms | 38684 kb | Accepted | ||||||||
5 | 105 ms | 38816 kb | Accepted | ||||||||
6 | 102 ms | 38568 kb | Accepted | ||||||||
7 | 104 ms | 38656 kb | Accepted | ||||||||
8 | 102 ms | 38284 kb | Accepted | ||||||||
9 | 104 ms | 41880 kb | Accepted | ||||||||
10 | 104 ms | 38484 kb | Accepted | ||||||||
11 | 101 ms | 38468 kb | Accepted | ||||||||
12 | 101 ms | 38584 kb | Accepted | ||||||||
13 | 102 ms | 38476 kb | Accepted | ||||||||
14 | 107 ms | 38772 kb | Accepted | ||||||||
15 | 104 ms | 42036 kb | Accepted | ||||||||
16 | 106 ms | 41920 kb | Accepted | ||||||||
17 | 103 ms | 38788 kb | Accepted | ||||||||
18 | 101 ms | 38512 kb | Accepted | ||||||||
19 | 106 ms | 40672 kb | Accepted | ||||||||
20 | 103 ms | 40436 kb | Accepted | ||||||||
21 | 103 ms | 40340 kb | Accepted | ||||||||
Source Code
program.java
import java.util.Scanner; public class Main { // Read the total amount of liquid in jar A (n) int n = sc.nextInt(); // Read the maximum amount of liquid that can be shifted in a move (m) int m = sc.nextInt(); // Calculate the minimum number of moves required int moves = n / m; if (n % m != 0) { moves++; // If there's any remainder, add one more move } // Output the minimum moves required } }