/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 532.0 KiB
#2 Accepted 2ms 532.0 KiB
#3 Accepted 191ms 1.02 MiB
#4 Accepted 205ms 1.27 MiB

Code

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        if(n%2!=0){
            cout<<n/2<<endl;
        }
        else{
            cout<<(n/2)-1<<endl;
        }
    }
}

Information

Submit By
Type
Submission
Problem
P1073 Pair Sum
Language
C++17 (G++ 13.2.0)
Submit At
2024-08-17 14:33:31
Judged At
2024-08-17 14:33:31
Judged By
Score
100
Total Time
205ms
Peak Memory
1.27 MiB