0
0

More than 3 years have passed since last update.

yukicoder contest 311 参戦記

Posted at

yukicoder contest 311 参戦記

1時間遅れの参加でAしか解けませんでした.

A 1656 Recuperation

B 日でストレスが A×B になって、それを癒やすのに A×B 日かかるので、合計日数は B + A×B = (A+1)B 日ですね.

from sys import stdin

readline = stdin.readline

T = int(readline())

result = []
for _ in range(T):
    A, B = map(int, readline().split())
    result.append((A + 1) * B)
print(*result, sep='\n')

C 1658 Product / Sum

直感的に A1=x, A2=y, A3=1, A4=1, ..., AN=1 なんだろうなと思い、xy/(x + y + N - 2) = K という式を書きましたが、ここから式変形する才能がありませんでした orz.

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

result = [1] * N
result[0] = 2 * K
result[1] = 2 * K + N - 2
print(*result)
0
0
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
0
0