[PYTHON] AtCoder Panasonic Programming Contest 2020 Participation Report

AtCoder Panasonic Programming Contest 2020 Participation Report

panasonic2020A - Kth Term

Break through in two and a half minutes. Well, just write.

K = int(input())

t = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(t[K - 1])

panasonic2020B - Bishop

Break through in about 6 minutes. 1WA. I completely forgot the case where H and W are 1.

H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
elif W % 2 == 0:
    print(H * W // 2)
else:
    if H % 2 == 0:
        print(H * W // 2)
    else:
        print((W + 1) // 2 + (H - 1) * W // 2)

panasonic2020C - Sqrt Inequality

Lost. Even though I knew that I had to calculate with an integer, I couldn't drop it into an integer formula. If I was told that I should square it twice, I would understand it immediately. For some reason, I don't know during the contest. orz. I hate math problems.

a, b, c = map(int, input().split())

if c - a - b > 0 and (c - a - b) * (c - a - b) > 4 * a * b:
    print('Yes')
else:
    print('No')

panasonic2020D - String Equivalence

Break through in 32 and a half minutes. 1WA. No matter how many times I read it, I was in trouble because the definition did not come to my mind. So, I completely misunderstood the definition and ate WA, and then until about N = 4 I finally understood by writing everything by hand AC. In short, the answer is that I added the character string from a to the next one in the largest dictionary order of the characters that have appeared so far.

N = int(input())

q = ['a']
for i in range(N - 1):
    nq = []
    for s in q:
        stop = ord(max(s)) + 2
        for i in range(ord('a'), stop):
            nq.append(s + chr(i))
    q = nq
for s in q:
    print(s)

Recommended Posts

AtCoder Panasonic Programming Contest 2020 Participation Report
AtCoder HHKB Programming Contest 2020 Participation Report
AtCoder Acing Programming Contest 2020 Participation Report
AtCoder Keyence Programming Contest 2020 Participation Report
AtCoder Beginner Contest 181 Participation Report
AtCoder Beginner Contest 161 Participation Report
AtCoder Beginner Contest 176 Participation Report
AtCoder Beginner Contest 154 Participation Report
AtCoder Grand Contest 041 Participation Report
AtCoder Beginner Contest 166 Participation Report
AtCoder Beginner Contest 153 Participation Report
AtCoder Beginner Contest 145 Participation Report
AtCoder Beginner Contest 184 Participation Report
AtCoder Beginner Contest 160 Participation Report
AtCoder Beginner Contest 169 Participation Report
AtCoder Beginner Contest 178 Participation Report
AtCoder Beginner Contest 163 Participation Report
AtCoder Beginner Contest 159 Participation Report
AtCoder Beginner Contest 164 Participation Report
AtCoder Regular Contest 105 Participation Report
AtCoder Beginner Contest 168 Participation Report
AtCoder Beginner Contest 150 Participation Report
AtCoder Beginner Contest 158 Participation Report
AtCoder Beginner Contest 180 Participation Report
AtCoder Regular Contest 104 Participation Report
AtCoder Beginner Contest 162 Participation Report
AtCoder Beginner Contest 157 Participation Report
AtCoder Beginner Contest 167 Participation Report
AtCoder Beginner Contest 179 Participation Report
AtCoder Beginner Contest 182 Participation Report
AtCoder Beginner Contest 146 Participation Report
AtCoder Beginner Contest 152 Participation Report
AtCoder Beginner Contest 155 Participation Report
AtCoder Beginner Contest 174 Participation Report
AtCoder Beginner Contest 148 Participation Report
AtCoder Beginner Contest 188 Participation Report
AtCoder Beginner Contest 170 Participation Report
AtCoder Beginner Contest 187 Participation Report
AtCoder Chokudai Contest 005 Participation Report
AtCoder Grand Contest 047 Participation Report
AtCoder Beginner Contest 183 Participation Report
AtCoder Sumitomo Mitsui Trust Bank Programming Contest 2019 Participation Report
AtCoder Hitachi, Ltd. Social Systems Division Programming Contest 2020 Participation Report
AtCoder Library Practice Contest Participation Report (Python)
AtCoder Introduction to Heuristics Contest Participation Report
AtCoder Judge System Update Test Contest 202004 Participation Report
Atcoder Acing Programming Contest Python
AtCoder Beginner Contest # 003 Participation Note
ACL Beginner Contest Participation Report
Atcoder Beginner Contest 146 Participation Diary
atcoder Review of Panasonic Programming Contest 2020, up to question E (Python)
AtCoder 3rd Algorithm Practical Test Participation Report
AtCoder Beginner Contest 177
abc154 participation report
abc155 participation report
AtCoder Beginner Contest 179
Acing Programming Contest 2020
AtCoder Beginner Contest 172
AtCoder Beginner Contest 180
HHKB Programming Contest 2020
Atcoder Beginner Contest 153