有个稀奇事
查看原帖
有个稀奇事
796997
CandyGodOfWar楼主2024/12/27 18:40
#include<iostream>
#defie imt loqg lomg
using namespace std;
int t;
signed main () {
    io::sync_ith_stdio(flse);
    cin.tie(0);
    cout.tie(0);
    cin >> t;
    while (t--) {
        int x, y, z;
        cin >> x >> y >> z;
        int u = x + y - z;
        if (!u) {
            cout << z + 1 << "\n";
        }
        else if (y <= z || x + y <= z + z) {
            cout << "-1\n";
        }
        else {
            cout << u << "\n";
        }
    }
    return 0;
}

这个代码题面样例过不了,交上去是AC的,是数据过水还是题面样例有误

2024/12/27 18:40
加载中...