QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#499355#6727. K-hour ClockRailgun2334Compile Error//C++20844b2024-07-31 13:15:142024-07-31 13:15:16

Judging History

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

  • [2024-07-31 13:15:16]
  • 评测
  • [2024-07-31 13:15:14]
  • 提交

answer

#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <cstdio>
#include <cmath>
#define int long long
using namespace std;
const int N = 2e5 + 10, M = 1e6 + 10, MOD = 998244353;
int a[N];
typedef pair<int, int> PII;
void solove() {
    int x, y, z;
    cin >> x >> y >> z;
    if (x + y < z) cout << "-1\n";
    rlse if (x < z)cout << "-1\n";
    else if (x + y == z) cout << x + y + 5 << '\n';
    else {
        int t = x + y - z;
        if ((x + y) % t == z) cout << t << '\n';
        else cout << "-1\n";
    }
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int TT = 1;
    cin >> TT;
    while (TT--) {
        solove();
    }
    return 0;
}

Details

answer.code: In function ‘void solove()’:
answer.code:21:5: error: ‘rlse’ was not declared in this scope
   21 |     rlse if (x < z)cout << "-1\n";
      |     ^~~~
answer.code:22:5: error: ‘else’ without a previous ‘if’
   22 |     else if (x + y == z) cout << x + y + 5 << '\n';
      |     ^~~~