0
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.

yukicoder contest 262 参戦記

Last updated at Posted at 2020-08-21

yukicoder contest 262 参戦記

寝坊して40分遅れくらいで参加したら、ジャッジがちょうど止まってて、なんかやたらと Clar が多くて、D問題が不備行きになるし、いやなんかすごい回だった(笑).

A 1175 Simultaneous Equations

普通に中学生の数学なので、係数を揃えて引いて x か y を消して……って感じですよね.

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

y = (c - f * a / d) / (b - e * a / d)
x = c / a - (b / a) * y
print(x, y)

B 1176 少ない質問

だいたい底を2にするのが最適なんだろうけど、そうじゃないやつがあることは A=9 などすぐ思いつく. ただまあ、考慮するべき底はそんなに無いであろうと直感的に思うので、適当に小さい数を試してAC.

from math import ceil, log

A = int(input())

result = float('inf')
for i in range(2, 100):
    result = min(result, i * ceil(log(A, i)))
print(result)

C 1177 余りは?

解けず. 難易度詐欺. ★1.5から★2.5に変化した.

D 1178 Can you draw a Circle?

制限で a = b なので、b を入力で受け取る意味が謎. 円の方程式に従って計算するだけではある.

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

x = c / a / 2
y = d / a / 2
t = f / a - e / a + x * x + y * y
print(t ** 0.5)

E 1179 Quadratic Equation

二次方程式の解の公式は中学生の数学なので、その通りに解くだけって感じですね.

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

t = b * b - 4 * a * c
if t < 0:
    print('imaginary')
elif t == 0:
    print(-b / (2 * a))
else:
    t = t ** 0.5
    result = [(-b - t) / (2 * a), (-b + t) / (2 * a)]
    result.sort()
    print(*result)
0
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
0
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?