QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#842461 | #9969. Kindergarten Square | ucup-team087# | RE | 0ms | 3944kb | C++14 | 1.8kb | 2025-01-04 13:06:03 | 2025-01-04 13:06:03 |
Judging History
answer
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")
constexpr Int LIM = 100'000;
int main() {
for (int numCases; ~scanf("%d", &numCases); ) { for (int caseId = 1; caseId <= numCases; ++caseId) {
Int A, B, C, D;
scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
--A;
--B;
--C;
--D;
const Int W = C - A;
const Int Y = A % W;
if (2 <= W && W <= LIM && 0 <= Y && Y + 1 < W && A + 1 == B && C + 1 == D) {
printf("%lld %lld\n", LIM, W);
} else {
puts("-1");
}
}
#ifndef LOCAL
break;
#endif
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3944kb
input:
4 6 7 10 11 2 3 4 5 8 5 5 13 1 2 5 6
output:
100000 4 -1 -1 100000 4
result:
ok All testcases passed.
Test #2:
score: -100
Runtime Error
input:
10 1 2 4 5 4 3 2 1 1 2 5 6 2 3 5 6 2 3 6 7 3 4 6 7 2 1 3 4 1 2 2 3 2 3 3 4 7 7 7 7