Loading...
Submission
Id When Author Problem Language CPU Memory Verdict
17888 2024-04-24 03:50:38 dnt Sum Game II Java 110 ms 42472 kb Wrong Answer - 4
Test Cases
CPU Memory Verdict
1 108 ms 42164 kb Accepted
2 104 ms 42472 kb Accepted
3 110 ms 40520 kb Accepted
4 105 ms 38736 kb Wrong Answer
5 - - Skipped
6 - - Skipped
7 - - Skipped
Source Code
program.java
Download
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class CompetitiveExam {
  5.  
  6.  
  7. public static void main(String[] args) {
  8. // TODO code application logic here
  9. Scanner sc = new Scanner(System.in);
  10. int t = sc.nextInt();
  11. for(int i =0;i<t;i++){
  12. int n = sc.nextInt();
  13. int sum = (n*(n-1))/2;
  14. System.out.println(sum);
  15. }
  16. }
  17.  
  18. }
  19.