[PYTHON] AtCoder Keyence Programming Contest 2020 Participation Report

AtCoder Keyence Programming Contest 2020 Participation Report

A - Painting

It breaks through in 9 and a half minutes. How many times should I apply it in the vertically and horizontally long ones? That's it. Because I misunderstood at first and thought that I would apply it alternately, it took time and the ranking was bottomed out ....

H = int(input())
W = int(input())
N = int(input())

t = max(H, W)
print((N + t - 1) // t)

C - Subarray Sum

Break through in 13 minutes. All you have to do is line up K S and N --K that do not add up to S. Each value in the sequence of answers should be 1-10 9 </ sup>. Be careful.

N, K, S = map(int, input().split())

result = [S % 10 ** 9 + 1] * N
for i in range(K):
    result[i] = S
print(*result)

B - Robot Arms

Defeated.

Addendum: I dropped the explanation into Python code and AC. The only part that was different from the WA-eaten code I wrote was whether to sort by x or by x + l ...

N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

t = [(x + l, x - l) for x, l in XL]
t.sort()
max_r = -float('inf')
result = 0
for i in range(N):
    r, l = t[i]
    if max_r <= l:
        result += 1
        max_r = r
print(result)

Recommended Posts

AtCoder Keyence Programming Contest 2020 Participation Report
AtCoder HHKB Programming Contest 2020 Participation Report
AtCoder Acing Programming Contest 2020 Participation Report
AtCoder Panasonic Programming Contest 2020 Participation Report
AtCoder Beginner Contest 161 Participation Report
AtCoder Beginner Contest 151 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 Grand Contest 040 Participation Report
AtCoder Beginner Contest 153 Participation Report
AtCoder Beginner Contest 145 Participation Report
AtCoder Beginner Contest 184 Participation Report
AtCoder Beginner Contest 165 Participation Report
AtCoder Beginner Contest 160 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 156 Participation Report
AtCoder Beginner Contest 162 Participation Report
AtCoder Beginner Contest 157 Participation Report
AtCoder Beginner Contest 167 Participation Report
AtCoder Beginner Contest 182 Participation Report
AtCoder Beginner Contest 152 Participation Report
AtCoder Beginner Contest 155 Participation Report
AtCoder Beginner Contest 174 Participation Report
AtCoder Beginner Contest 171 Participation Report
AtCoder Beginner Contest 149 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 Library Practice Contest Participation Report (Python)
AtCoder Introduction to Heuristics Contest Participation Report
Keyence Programming Contest 2020 Review
Keyence Programming Contest 2021 Notes
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 3rd Algorithm Practical Test Participation Report
AtCoder Beginner Contest 177
abc154 participation report
abc155 participation report
Acing Programming Contest 2020
AtCoder Beginner Contest 172
HHKB Programming Contest 2020
AtCoder Beginner Contest 173