結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,840 KB
testcase_01 AC 36 ms
51,456 KB
testcase_02 AC 37 ms
51,584 KB
testcase_03 AC 39 ms
56,960 KB
testcase_04 AC 40 ms
56,704 KB
testcase_05 AC 39 ms
57,472 KB
testcase_06 AC 40 ms
57,216 KB
testcase_07 AC 46 ms
61,184 KB
testcase_08 AC 362 ms
78,464 KB
testcase_09 AC 506 ms
80,000 KB
testcase_10 AC 475 ms
79,232 KB
testcase_11 AC 456 ms
79,104 KB
testcase_12 AC 408 ms
78,720 KB
testcase_13 AC 140 ms
76,288 KB
testcase_14 AC 310 ms
78,336 KB
testcase_15 AC 400 ms
79,208 KB
testcase_16 AC 156 ms
77,140 KB
testcase_17 AC 185 ms
77,072 KB
testcase_18 AC 562 ms
80,720 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