/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 3ms 324.0 KiB
#2 Accepted 3ms 512.0 KiB
#3 Accepted 18ms 964.0 KiB
#4 Accepted 19ms 1.48 MiB

Code

/*
ALLAH IS THE GREATEST
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl "\n"
const ll Mod = 2e18+7;
const ll N = 1e5+7;
#define Subhanallah_Alhamdulillah_Allahu_Akbar ios_base::sync_with_stdio(false);cin.tie(NULL);
bool bs[10000007];
const ll sz = 1e6+5;
typedef pair<ll,ll>pi;
vector<ll>prime;
ll vis[N];
ll arr[N];
vector<ll>graph[N];
void sieve()
{
    bs[0]=bs[1]=1;
    for(ll i=3;i*i<=sz;i+=2)
    {
        if(!bs[i])
        {
            for(ll j=i*i;j<=sz;j+=i)
            {
                bs[j]=1;
            }
        }
    }
    prime.push_back(2);
    for(ll i=3;i<=sz;i+=2)
    {
        if(!bs[i])
        {
            prime.push_back(i);
        }
    }
    sort(prime.rbegin(),prime.rend());
}
ll mod(ll a, ll m){
    return (a % m + m) % m;
}
ll biexpo(ll base,ll power)
{
    ll ans =1;
    while(power)
    {
        if(power%2==1)
        {
            ans=(ans*base);
            power--;
        }
        else
        {
            base=(base*base);
            power/=2;
        }
    }
    return ans;
}
ll dfs(ll n)
{
    vector<ll>v;
    vis[n]=1;
    stack<ll>st;
    st.push(n);
    while(!st.empty())
    {
    ll cur = st.top();
    v.push_back(cur);
    st.pop();
    for(auto &i:graph[cur])
    {
        if(!vis[i])
        {
            st.push(i);
            vis[i]=1;
        }
    }
    }
    ll mi = 1e18;
    for(auto &k:v)
    {
        mi = min(mi,arr[k-1]);
    }
    return mi;
}
ll digsum(ll a)
{
    ll sum=0;
    while(a)
    {
        sum+=(a%10);
        a/=10;
    }
    return sum;
}
int main()
{
    Subhanallah_Alhamdulillah_Allahu_Akbar
    //Think positively and move on
    ll t=1;
    cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        cout<<(n+1)/2-1<<nl;
    }
    return 0;
}

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:45:28
Judged At
2024-10-03 13:30:04
Judged By
Score
100
Total Time
19ms
Peak Memory
1.48 MiB