Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...)
#endif
void solve() {
ll k;
cin >> k;
ll d = sqrt(9ll + 8ll *k);
ll n = (-3 + d) /2;
ll pidx = ((n-1)*(n+3-1))/2;
cout << (k-pidx == n+1 ? "a":"b" ) << endl;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t; cin >> t;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:48:56
- Judged At
- 2026-01-06 15:48:56
- Judged By
- Score
- 0
- Total Time
- 171ms
- Peak Memory
- 756.0 KiB