你梦熊语法组 T2 样例没过求条,玄关
  • 板块灌水区
  • 楼主Xalfz_
  • 当前回复4
  • 已保存回复4
  • 发布时间2024/8/30 14:10
  • 上次更新2024/8/30 17:19:57
查看原帖
你梦熊语法组 T2 样例没过求条,玄关
1148621
Xalfz_楼主2024/8/30 14:10

#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef long long LL;
const int N = 1e2 + 2;
const int M = 1e6 + 2;
const int K = 2e6 + 2;
const int INF = 0x3f3f3f3f;
int test, xa, xb, xc, maxx;

signed main() {
    scanf("%lld", &test);
    while (test--) {
        scanf("%lld%lld%lld", &xa, &xb, &xc);
        maxx = max({xa, xb, xc});
        if ((3 * maxx - xa - xb - xc) % 3 == 0) {
            printf("%lld\n", (3 * maxx - xa - xb - xc) / 3);
        } else {
            puts("-1");
        }
    }
    return 0;
}

前 3 个数据都过了,就是最后一个样例怎么没过(结果恰好是两倍)/kk

2024/8/30 14:10
加载中...