/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 368.0 KiB
#2 Accepted 1ms 492.0 KiB
#3 Accepted 17ms 1.02 MiB
#4 Accepted 19ms 1.27 MiB

Code

#include <bits/stdc++.h>
#include <cmath>
#include <bitset>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>pbds;
#define ll  long long  int
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define    gcd(a,b)         __gcd(a,b)
#define    lcm(a,b)        ((a*b)/gcd(a,b))
#define    pi               acos(-1.00)
const int mod=1000000007;
void evan() {
 ll n;
 cin>>n;
 if(n%2==0){
   cout<<(n/2)-1<<"\n";
 }
 else cout<<n/2<<"\n";
}
signed main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(nullptr);
   int t=1;
   cin>>t;
  for(int i=1;i<=t;i++) evan();
}

Information

Submit By
Type
Submission
Problem
P1073 Pair Sum
Contest
Bangladesh 2.0
Language
C++20 (G++ 13.2.0)
Submit At
2024-08-16 15:34:31
Judged At
2024-08-16 15:34:31
Judged By
Score
100
Total Time
19ms
Peak Memory
1.27 MiB