/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Wrong Answer 1ms 532.0 KiB
#3 Wrong Answer 2ms 320.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;

#define fastkor ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define endl '\n'
#define ll long long

#define dvect vector<int>vect
#define pb(x) push_back(x)
#define vectinL(n) for(ll i=0;i<n;i++){ ll x; cin >> x; vect.push_back(x);}
#define vectin(n) for(int i=0;i<n;i++){ int x; cin >> x; vect.push_back(x);}
#define vectout(v) for(auto p: v) cout<<p<<" "; cout<<endl;
#define sortkor(x) sort(x.begin(),x.end())
#define reversekor(x) reverse(x.begin(),x.end())
#define all(vect) vect.begin(),vect.end()
#define mini_pos(a)    ( min_element((a).begin(), (a).end()) - (a).begin())
#define maxi_pos(a)    ( max_element((a).begin(), (a).end()) - (a).begin())

#define F first
#define S second
#define gcd(a,b) __gcd(a,b)
#define YES1 cout<<"Case "<<case++<<": YES\n"
#define NO1 cout<<"Case "<<case++<<": NO\n"
#define precision(n) fixed<<setprecision(n)
#define testcase ll t; cin >>t; while(t--)

#define yes cout<<"yes\n";
#define Yes cout<<"Yes\n";
#define YES cout<<"YES\n"

#define no cout<<"no\n";
#define No cout<<"No\n";
#define NO cout<<"NO\n"
#define vectd  vector<ll>vect(n)
const int N=2e5+10;
vector<pair<int,int>>moves=
{
    {-1,0},{1,0},{0,-1},{0,1}
};
const int mod=1e9+7;
ll fact[N+10];
vector<bool>isprime;
vector<int>primegula;
map<int,int>mp;
template <typename T>
inline void operator>>(istream &istream, vector<T> &v)
{
    for (T &i : v)
    {
        cin >> i;
    }
}

int main()
{
    fastkor;
    testcase
    {
        ll n;
        cin >> n;

        ll od=n/2;
        ll ev=n/2;

        if(n&1)
            ev++;

        if(od%2==0 && ev%2==0)
        {
           cout<<(n/2)<<"\n";
        }
        else
        {
            cout<<1<<"\n";
        }
    }
 
}

Information

Submit By
Type
Submission
Problem
P1052 Yet Another Array Partition
Language
C++20 (G++ 13.2.0)
Submit At
2024-09-06 12:55:19
Judged At
2024-11-11 02:56:12
Judged By
Score
5
Total Time
2ms
Peak Memory
532.0 KiB