/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 13ms 3.113 MiB
#2 Accepted 492ms 3.312 MiB
#3 Accepted 502ms 3.336 MiB
#4 Accepted 500ms 3.297 MiB

Code

from math import sqrt

def isSquare(k):
    return int(sqrt(k))**2 == k

def isTriangleNumber(k):
    return isSquare(8*k + 9)

def kthChar(k):
    return 'b' if isTriangleNumber(k) else 'a'

t = int(input())
for _ in range(t):
    k = int(input())
    print(kthChar(k))

Information

Submit By
Type
Submission
Problem
P1223 C. Infinity Sequence
Contest
Happy New Year 2026
Language
Python 3 (Python 3.12.3)
Submit At
2026-01-06 16:08:14
Judged At
2026-01-06 16:08:14
Judged By
Score
100
Total Time
502ms
Peak Memory
3.336 MiB