Submission
Id | When | Author | Problem | Language | CPU | Memory | Verdict |
---|---|---|---|---|---|---|---|
17889 | 2024-04-24 03:52:41 | dnt | Sum Game II | Java | 1102 ms | 42232 kb | Time Limit Exceeded - 4 |
Test Cases
CPU | Memory | Verdict | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
1 | 103 ms | 38648 kb | Accepted | ||||||||
2 | 108 ms | 42148 kb | Accepted | ||||||||
3 | 107 ms | 42232 kb | Accepted | ||||||||
4 | 1102 ms | 652 kb | Time Limit Exceeded | ||||||||
5 | - | - | Skipped | ||||||||
6 | - | - | Skipped | ||||||||
7 | - | - | Skipped | ||||||||
Source Code
program.java
import java.util.Scanner; public class Main { // Read the number of test cases int t = sc.nextInt(); for (int i = 0; i < t; i++) { // Read the number of friends long n = sc.nextLong(); // Calculate the sum of numbers from 0 to n-1 long sum = 0; for (long j = 0; j < n; j++) { sum += j; } // Output the sum } } }