QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#499441#6727. K-hour ClockbuzhijingdiWA 0ms3648kbC++14591b2024-07-31 14:17:042024-07-31 14:17:06

Judging History

你现在查看的是最新测评结果

  • [2024-07-31 14:17:06]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3648kb
  • [2024-07-31 14:17:04]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 2e5 + 9;
const int mod = 1e9 + 7;
#define eps 1e-5
#define inf 2e18
ll a, b, c;



void solve()
{
    cin >> a >> b >> c;

    ll k = a + b - c;
    if (k < 0)
    {
        cout << "-1" << '\n';
        return;
    }
    else if (k == 0) {
        cout << a + b + 1 << endl;
    }
    else {
        cout << k*k << '\n';
    }

    

}

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int _ = 1; cin >> _;
    while (_--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3648kb

input:

4
11 18 5
3 49 4
1 9 1
1 3 10

output:

576
2304
81
-1

result:

wrong answer Case #1: x + y != z (mod k) (x = 11, y = 18, z = 5, k = 576)