QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#348920#6563. Four Squarerealcomplex0#Compile Error//C++201.3kb2024-03-09 22:19:232024-03-09 22:19:24

Judging History

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

  • [2024-03-09 22:19:24]
  • 评测
  • [2024-03-09 22:19:23]
  • 提交

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;
            }
            if(b[0].se + b[1].se == b[3].se && b[0].fi == b[1].fi && b[2].fi == b[1].fi + b[3].fi && b[2].fi == b[2].se + b[3].se){
                cout << "1\n"
                return 0;
            }
        }
    }while(next_permutation(a.begin(), a.end()));
    cout << "0\n";
    return 0;
}

详细

answer.code: In function ‘int main()’:
answer.code:35:30: error: expected ‘;’ before ‘return’
   35 |                 cout << "1\n"
      |                              ^
      |                              ;
   36 |                 return 0;
      |                 ~~~~~~