Loading...
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
Download
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6.  
  7. // Read the total amount of liquid in jar A (n)
  8. int n = sc.nextInt();
  9.  
  10. // Read the maximum amount of liquid that can be shifted in a move (m)
  11. int m = sc.nextInt();
  12.  
  13. // Calculate the minimum number of moves required
  14. int moves = n / m;
  15. if (n % m != 0) {
  16. moves++; // If there's any remainder, add one more move
  17. }
  18.  
  19. // Output the minimum moves required
  20. System.out.println(moves);
  21. }
  22. }
  23.