結果

問題 No.2233 Average
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-05-11 22:45:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 601 ms / 2,000 ms
コード長 672 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 80,732 KB
最終ジャッジ日時 2024-05-05 18:33:27
合計ジャッジ時間 7,048 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,712 KB
testcase_01 AC 39 ms
52,480 KB
testcase_02 AC 36 ms
51,712 KB
testcase_03 AC 39 ms
57,344 KB
testcase_04 AC 40 ms
56,832 KB
testcase_05 AC 39 ms
57,856 KB
testcase_06 AC 39 ms
57,088 KB
testcase_07 AC 48 ms
61,696 KB
testcase_08 AC 365 ms
78,976 KB
testcase_09 AC 519 ms
80,340 KB
testcase_10 AC 473 ms
79,336 KB
testcase_11 AC 466 ms
79,488 KB
testcase_12 AC 420 ms
78,964 KB
testcase_13 AC 144 ms
76,596 KB
testcase_14 AC 316 ms
78,464 KB
testcase_15 AC 397 ms
78,976 KB
testcase_16 AC 155 ms
77,300 KB
testcase_17 AC 184 ms
77,248 KB
testcase_18 AC 601 ms
80,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

https://yukicoder.me/problems/no/2233

全部偶数だったら、繰り返しそう?
実装適当なのでwa出そう

"""

import sys
from sys import stdin

TT = int(stdin.readline())

for loop in range(TT):

    a,b,c,K = map(int,stdin.readline().split())

    dic = {}

    dic[(a,b,c)] = 0
    lis = [a+b+c]

    for i in range(1,K+1):

        a,b,c = (b+c)//2 , (c+a)//2 , (a+b)//2
        lis.append(a+b+c)

        tup = (a,b,c)

        if i == K:
            print (a+b+c)
            break

        if tup in dic:
            rem = i - dic[tup]
            print (lis[dic[tup] + rem])
            break

        dic[tup] = i

            
            
0