/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 532.0 KiB
#2 Accepted 13ms 708.0 KiB
#3 Wrong Answer 41ms 788.0 KiB
#4 Accepted 33ms 712.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#ifndef ONLINE_JUDGE
    #define dbg(x) cout << #x << ":- " << x << "\n"
#else
    #define dbg(x)
#endif
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(),x.rend()
#define MOD 1000000007
//-----------------------------------------------------------------------------//
void print(vector<ll>arr){for(int i=0;i<arr.size();i++){cout<<arr[i]<<" ";}
cout<<endl;}
void print(map<ll,ll>mpp){for(auto x:mpp){cout<<x.first<<"-->"<<x.second<<"\n";}
cout<<endl;}
void print(set<ll>s){for(auto x:s){cout<<x<<" ";}cout<<endl;}
/*                                       OBSERVATIONS
//------------------------------------------------------------------------------//
let say i have x
then if p is the smallest pf
and q is the largest pf
then, 
if k is even
we do

x* p^(k/2)
    q^(k/2)


//------------------------------------------------------------------------------//
 */ 

vector<int>primes;
void sieve_of_eratosthenes(int n) {
    vector<bool> is_prime(n + 1, true);
    is_prime[0] = is_prime[1] = false; // 0 and 1 are not prime numbers
    
    for (int i = 2; i * i <= n; ++i) {
        if (is_prime[i]) {
            // Marking all multiples of i as not prime
            for (int j = i * i; j <= n; j += i) {
                is_prime[j] = false;
            }
        }
    }
    
    for (int i = 2; i <= n; ++i) {
        if (is_prime[i]) {
            primes.push_back(i);
        }
    }

}

int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
sieve_of_eratosthenes(1e5);
int t;
cin>>t;
while(t--){
 ll n;
 cin>>n;
 long double tt=2.25+2*n;
 long double k=sqrtl(tt);
 long double temp=k-1.5;
//  dbg(temp);
 if(floor(temp)==temp)cout<<"b\n";
 else cout<<"a\n";

}
return 0;
}

Information

Submit By
Type
Submission
Problem
P1223 C. Infinity Sequence
Contest
Happy New Year 2026
Language
C++17 (G++ 13.2.0)
Submit At
2026-01-06 16:50:40
Judged At
2026-01-06 16:50:40
Judged By
Score
60
Total Time
41ms
Peak Memory
788.0 KiB