1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AtCoder M-SOLUTIONS プロコンオープン 2020 参戦記

Last updated at Posted at 2020-07-25

AtCoder M-SOLUTIONS プロコンオープン 2020 参戦記

m-solutions2020A - Kyu in AtCoder

4分で突破. 書くだけ……だったが、4分もかかってしまっていると、さすがに素直に200で割って処理すべきだったと反省.

X = int(input())

if 400 <= X <= 599:
    print(8)
elif 600 <= X <= 799:
    print(7)
elif 800 <= X <= 999:
    print(6)
elif 1000 <= X <= 1199:
    print(5)
elif 1200 <= X <= 1399:
    print(4)
elif 1400 <= X <= 1599:
    print(3)
elif 1600 <= X <= 1799:
    print(2)
elif X >= 1800:
    print(1)

m-solutions2020B - Magic 2

3分で突破. 2倍なら素直にループを回しても大丈夫だろうと、素直に書き下ろした.

A, B, C = map(int, input().split())
K = int(input())

while A >= B:
    K -= 1
    B *= 2

while B >= C:
    K -= 1
    C *= 2

if K >= 0:
    print('Yes')
else:
    print('No')

m-solutions2020C - Marks

13分半で突破. TLE1. 固定窓だと思った私がアホでした. なまじ TLE になるものの計算は出来てしまうのが裏目になってしまう Python だった.

N, K = map(int, input().split())
A = list(map(int, input().split()))

result = []
for i in range(K, N):
    if A[i] > A[i - K]:
        result.append('Yes')
    else:
        result.append('No')
print(*result, sep='\n')

m-solutions2020D - Road to Millionaire

18分半で突破. DP だろうけど、どう DP 回せばいいんだろうなとそこそこ悩んだ. N≤80 なので O(N2) でも大丈夫なので、全ての売り買いパターンの最大値を取ればいいだけだった.

N = int(input())
A = list(map(int, input().split()))

t = [-1] * (N + 1)
t[0] = 1000
for i in range(N):
    k = t[i] // A[i]
    y = t[i] % A[i]
    for j in range(i, N):
        t[j + 1] = max(t[j + 1], k * A[j] + y)
print(t[N])

m-solutions2020E - M's Solution

突破できず. 途中で順位表を見て F の方が簡単なことに途中で気づいたが、気づいた時点では時間的に手遅れ. 正しい答えが出るナイーブなコードは書けたが、そこから計算量を減らせず.

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?