/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 67ms 76.938 MiB
#2 Accepted 232ms 77.141 MiB
#3 Wrong Answer 233ms 77.02 MiB
#4 Accepted 233ms 77.02 MiB

Code

// Author: Shawn Das Shachin-->(shawn_das)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define pb push_back
#define mod 1000000007
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.rbegin(),v.rend())
#define OPTIMIZE_IO ios::sync_with_stdio(false); cin.tie(nullptr);
#define setbit(x) __builtin_popcount(x);
#define printp(v) { for(auto &it : v) std::cout << it.first << " " << it.second << std::endl; }
#define printarr(arr) { for(auto &it : arr) std::cout << it << " "; std::cout << std::endl; }
ll compute[10000000];

void cal() {
    ll k = 2;
    int i = 1;
    compute[i] = k;

    while (k < 1e17 && i + 1 < 10000000) {
        i++;
        k += (i + 1);
        compute[i] = k;
    }
}
bool bs(ll n) {
    ll left = 1, right = 9999999;
    while (left <= right) {
        int mid = left + (right - left) / 2;
        if (compute[mid] == n) return true;
        else if (compute[mid] < n) left = mid + 1;
        else right = mid - 1;
    }
    return false;
}

void solve(){
    ll n;
    cin >> n;
    if(bs(n))cout << 'b' << endl;
    else cout << 'a' << endl;

}
int main() {
    OPTIMIZE_IO;
    int t;
    cin>>t;
    cal();
    while(t--){
        solve();
    }
    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 15:54:06
Judged At
2026-01-06 15:54:06
Judged By
Score
60
Total Time
233ms
Peak Memory
77.141 MiB