Loading...
Submission
Id When Author Problem Language CPU Memory Verdict
4414 2022-03-23 16:07:15 M_Hasan Sum Game II C++ 17 3 ms 3444 kb Accepted
Test Cases
CPU Memory Verdict
1 2 ms 3444 kb Accepted
2 3 ms 3332 kb Accepted
3 2 ms 3388 kb Accepted
4 2 ms 3356 kb Accepted
5 3 ms 3348 kb Accepted
6 2 ms 3332 kb Accepted
7 2 ms 3392 kb Accepted
Source Code
program.cpp
Download
  1. #include<bits/stdc++.h>
  2. #define ll long long int
  3. #define pb push_back
  4. #define show(x) cout<<#x<<" : "<<x<<endl;
  5. #define vec vector<int>
  6. #define rall(x) x.rbegin(), x.rend()
  7. #define all(x) x.begin(), x.end()
  8. using namespace std;
  9.  
  10. void Solve(){
  11. ll n; cin>>n;
  12. cout<<(n*(n-1))/2<<endl;
  13.  
  14.  
  15.  
  16. }
  17.  
  18. int main(){
  19. int t = 1 ;
  20. cin>>t;
  21. while(t--)Solve();
  22. }
  23.  
  24.