답안 #1092799

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1092799 2024-09-25T07:16:32 Z vibeslayer Esej (COCI15_esej) Python 3
80 / 80
104 ms 11936 KB
a, b = map(int, input().split())
a = b

def f(x):
    return chr(x + ord('a'))


ans = []
cntr = 0
for c1 in range(0, 26):
    for c2 in range(0, 26):
        for c3 in range(0, 26):
            for c4 in range(0, 26):
                for c5 in range(0, 26):
                    s = f(c1) + f(c2) + f(c3) + f(c4) + f(c5)
                    ans.append(s)
                    cntr += 1
                    if cntr >= a:
                        break
                if cntr >= a:
                    break
            if cntr >= a:
                break
        if cntr >= a:
            break
    if cntr >= a:
        break

print(' '.join(ans))
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 2908 KB Output is correct
2 Correct 10 ms 2908 KB Output is correct
3 Correct 10 ms 2908 KB Output is correct
4 Correct 11 ms 3076 KB Output is correct
5 Correct 15 ms 3420 KB Output is correct
6 Correct 32 ms 5036 KB Output is correct
7 Correct 101 ms 11936 KB Output is correct
8 Correct 99 ms 11812 KB Output is correct
9 Correct 98 ms 11804 KB Output is correct
10 Correct 104 ms 11848 KB Output is correct