QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#348898#6563. Four Squarerealcomplex0#WA 1ms3820kbC++201.1kb2024-03-09 22:12:492024-03-09 22:12:51

Judging History

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

  • [2024-03-09 22:12:51]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3820kb
  • [2024-03-09 22:12:49]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair

int main(){
    vector<pii> a(4);
    for(int i = 0 ; i < 4; i ++ ){
        cin >> a[i].fi >> a[i].se;
    }
    sort(a.begin(), a.end());
    do{
        for(int m = 0 ; m < (1 << 4); m ++ ){
            vector<pii> b = a;
            for(int i = 0 ;i < 4; i ++ ){
                if((m & (1 << i))){
                    swap(b[i].fi, b[i].se);
                }
            }
            if(b[0].fi + b[1].fi == b[1].se && b[1].se == b[0].se + b[3].se && b[2].se == b[3].se && b[0].fi == b[2].fi + b[3].fi){
                cout << "1\n";
                return 0;
            }
            if(b[1].se + b[2].se == b[0].se + b[3].se && b[1].fi == b[2].fi && b[0].fi == b[3].fi && b[2].fi + b[3].fi == b[1].se + b[2].se){
                cout << "1\n";
                return 0;
            }

        }
    }while(next_permutation(a.begin(), a.end()));
    cout << "0\n";
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3820kb

input:

1 1
1 1
1 1
1 1

output:

1

result:

ok single line: '1'

Test #2:

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

input:

3 1
3 3
2 2
3 3

output:

0

result:

ok single line: '0'

Test #3:

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

input:

2 8
2 8
2 8
2 8

output:

0

result:

wrong answer 1st lines differ - expected: '1', found: '0'