Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
59459 张弛 2020 NK-S3-T1 C++ 编译错误 0 0 MS 0 KB 534 2022-10-12 17:13:56

Tests(0/0):


#include<bits/stdc++.h> using namespace std; int a , b , c , k; int main(){ // freopen("A.in" , "r" , stdin); // freopen("A.out" , "w" , stdout); int t; scanf("%d" , &t); while(t--){ scanf("%d%d%d%d" , &a , &b , &c , &k); while(k--){ if(a + b < c) c -= a + b , a *= 2 , b *= 2; else if(a + b == c){ printf("%d\n" , 0); continue; } else{ int w = min(a , b); int p = min(c / 2 , w - 1);; a -= p , b += p - c , c *= 2 } } printf("%d\n" , c); } return 0; }


测评信息: