QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#841933#9969. Kindergarten Squareucup-team6274#WA 0ms3652kbC++141.7kb2025-01-04 08:55:482025-01-04 08:55:54

Judging History

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

  • [2025-01-04 08:55:54]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3652kb
  • [2025-01-04 08:55:48]
  • 提交

answer

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
bool Mbg;
using namespace std;
#define vec vector
#define pb push_back
#define eb emplace_back
#define siz(vec) ((int)(vec).size())
#define all(vec) (vec).begin(),(vec).end()
template<class T>
void operator +=(vec<T> &a,T b){a.push_back(b);}
template<class T>
void operator --(vec<T> &a){a.pop_back();}
#define pii pair<int,int>
#define x first
#define y second
#define mp make_pair
#define exc(exp) if(exp)continue;
#define stop(exp) if(exp)break;
#define ret(exp) if(exp)return;
#define deb(var) cerr<<#var<<'='<<(var)<<"; "
#define debl(var) cerr<<#var<<'='<<(var)<<";\n"
#define ins insert
#define era erase
#define lb lower_bound
#define ub upper_bound
#define int long long
#define inf (long long)(1e18)
template<class T>
bool Min(T &x,T y){return x>y?x=y,1:0;}
template<class T>
bool Max(T &x,T y){return x<y?x=y,1:0;}
const int mod=1e9+7;
void Add(int &x,int y){x=x+y<mod?x+y:x+y-mod;}
void Dec(int &x,int y){x=x>=y?x-y:x-y+mod;}
int fpm(int x,int y){
    int ans=1;for(;y;y>>=1,(x*=x)%=mod)if(y&1)(ans*=x)%=mod;return ans;
}

int a,b,c,d;
void work(){
    cin>>a>>b>>c>>d;
    if(b-a!=1||d-c!=1||b>=c||c-a!=d-b)cout<<"-1\n";
    else{
        int m=c-a;

        if(m==2&&a%2!=1)cout<<"-1\n";
        else{
            cout<<"100000 "<<m<<'\n';
        }

    }
}
bool Med;
signed main(){
    ios::sync_with_stdio(0),
    cin.tie(0),cout.tie(0);
    int T=1;cin>>T;while(T--)work();
    // cerr<<"Time: "<<clock()<<" ms;\n";
    // cerr<<"Memory: "<<abs(&Med-&Mbg)/1024.0/1024.0<<" MiB.\n";
}
/*
- CONTINUE, NON-STOPPING, FOR THE FAITH
- START TYPING IF YOU DON'T KNOW WHAT TO DO
- STOP TYPING IF YOU DON'T KNOW WHAT YOU'RE DOING
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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
Wrong Answer
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
100000 3
-1
-1
-1
-1

result:

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