結果

問題 No.112 ややこしい鶴亀算
ユーザー 村上史弥村上史弥
提出日時 2022-11-24 22:04:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 533 ms / 5,000 ms
コード長 247 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 42,988 KB
最終ジャッジ日時 2024-04-08 19:03:10
合計ジャッジ時間 14,825 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 494 ms
42,988 KB
testcase_01 AC 533 ms
42,988 KB
testcase_02 AC 493 ms
42,988 KB
testcase_03 AC 495 ms
42,988 KB
testcase_04 AC 492 ms
42,988 KB
testcase_05 AC 501 ms
42,988 KB
testcase_06 AC 500 ms
42,988 KB
testcase_07 AC 500 ms
42,988 KB
testcase_08 AC 494 ms
42,988 KB
testcase_09 AC 499 ms
42,988 KB
testcase_10 AC 495 ms
42,988 KB
testcase_11 AC 492 ms
42,988 KB
testcase_12 AC 494 ms
42,988 KB
testcase_13 AC 493 ms
42,988 KB
testcase_14 AC 497 ms
42,988 KB
testcase_15 AC 498 ms
42,988 KB
testcase_16 AC 491 ms
42,988 KB
testcase_17 AC 499 ms
42,988 KB
testcase_18 AC 489 ms
42,988 KB
testcase_19 AC 503 ms
42,988 KB
testcase_20 AC 493 ms
42,988 KB
testcase_21 AC 495 ms
42,988 KB
testcase_22 AC 501 ms
42,988 KB
testcase_23 AC 495 ms
42,988 KB
testcase_24 AC 493 ms
42,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from numpy.linalg import solve

N = int(input())
a = input().split()
A = 0
for i in a:
    A += int(i)
num = A / (N - 1)

left = [[1, 1],
        [2, 4]]

right = [N, num]

x = solve(left, right)[0]
y = solve(left, right)[1]

print(int(x), int(y))
0