QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#843225#9969. Kindergarten Squareucup-team139#WA 0ms3732kbC++231.2kb2025-01-04 17:29:272025-01-04 17:29:29

Judging History

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

  • [2025-01-04 17:29:29]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3732kb
  • [2025-01-04 17:29:27]
  • 提交

answer

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <assert.h>
using namespace std;

void solve([[maybe_unused]] int t)
{
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  if (c - a != d - b || c - a <= 0 || a >= b || b >= c)
  {
    cout << "-1\n";
  }
  else
  {
    int w = c - a;
    if ((c - 1) / w != (d - 1) / w || (a - 1) / w != (b - 1) / w)
    {
      cout << "-1\n";
    }
    else
    {
      cout << d / w + 1 << " " << w << "\n";
    }
  }
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n = 1;
  cin >> n;
  for (int i = 1; i <= n; i++)
    solve(i);
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3732kb

input:

4
6 7
10 11
2 3
4 5
8 5
5 13
1 2
5 6

output:

3 4
-1
-1
2 4

result:

ok All testcases passed.

Test #2:

score: 0
Accepted
time: 0ms
memory: 3724kb

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

output:

2 3
-1
2 4
3 3
2 4
-1
-1
-1
-1
-1

result:

ok All testcases passed.

Test #3:

score: 0
Accepted
time: 0ms
memory: 3716kb

input:

10
1 1
1 1
1 2
3 4
1 2
5 7
4 5
7 8
1001 1002
1003 1004
1001 1002
1005 1007
1004 1005
1007 1008
249 250
251 252
250 251
250 251
250 250
250 251

output:

-1
3 2
-1
3 3
503 2
-1
337 3
127 2
-1
-1

result:

ok All testcases passed.

Test #4:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

10
249 251
250 251
249 250
250 251
249 250
251 251
249 250
251 251
51 52
61 62
50 52
61 62
52 52
61 62
51 51
61 62
51 53
61 62
51 52
60 62

output:

-1
-1
-1
-1
7 10
-1
-1
-1
-1
-1

result:

ok All testcases passed.

Test #5:

score: 0
Accepted
time: 0ms
memory: 3680kb

input:

10
51 52
62 62
51 52
61 61
51 52
61 63
109 110
119 120
108 110
119 120
110 110
119 120
109 109
119 120
109 111
119 120
109 110
118 120
109 110
120 120

output:

-1
-1
-1
13 10
-1
-1
-1
-1
-1
-1

result:

ok All testcases passed.

Test #6:

score: -100
Wrong Answer
time: 0ms
memory: 3576kb

input:

10
109 110
119 119
109 110
119 121
1050 1075
2050 2075
1 2
1001 1002
101 102
1101 1102
999 1000
1999 2000
2 2
1001 1002
1 1
1001 1002
1 3
1001 1002
1 2
1000 1002

output:

-1
-1
3 1000
2 1000
2 1000
3 1000
-1
-1
-1
-1

result:

wrong answer Incorrect H & W pair for the given 2x2 submatrix.