QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#842490#9969. Kindergarten Squareucup-team3474#RE 0ms3680kbC++23652b2025-01-04 13:11:352025-01-04 13:11:42

Judging History

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

  • [2025-01-04 13:11:42]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3680kb
  • [2025-01-04 13:11:35]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int N=2e6+10;
ll n,m,k;
ll ans;

void __(){
    ll a[10];
    for(int i=1;i<=4;i++){
        cin>>a[i];
    }
    
    if(a[3]-a[1]!=a[4]-a[2]||a[3]-a[1]<0||a[4]-a[2]<0){
        puts("-1");
        return;
    }
    if(a[2]-a[1]!=1||a[4]-a[3]!=1){
        puts("-1");
        return;
    }
    ll kuan=a[3]-a[1];
    if((a[3]-1)/kuan!=(a[4]-1)/kuan){
        puts("-1");
        return;
    }
    cout<<100000<<" "<<kuan<<endl;
}

int main()
{
    int _;
    cin>>_;
    while(_--){
        __();
    }
}
//51423

详细

Test #1:

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

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: 0
Accepted
time: 0ms
memory: 3580kb

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:

100000 3
-1
100000 4
100000 3
100000 4
-1
-1
-1
-1
-1

result:

ok All testcases passed.

Test #3:

score: -100
Runtime Error

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
100000 2
-1
100000 3
100000 2
-1
100000 3
100000 2

result: