QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#348963#6563. Four Squarerealcomplex0#Compile Error//C++201.7kb2024-03-09 22:38:202024-03-09 22:38:21

Judging History

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

  • [2024-03-09 22:38:21]
  • 评测
  • [2024-03-09 22:38:20]
  • 提交

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

            if(b[0].fi + b[1].fi + b[2].fi + b[3].fi == b[0].se && b[0].se == b[1].se && b[1].se == b[2].se && 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:50:2: error: expected ‘while’ at end of input
   50 | }
      |  ^
answer.code:50:2: error: expected ‘(’ at end of input
   50 | }
      |  ^
      |  (
answer.code:50:2: error: expected primary-expression at end of input
answer.code:50:2: error: expected ‘)’ at end of input
   50 | }
      |  ^
      |  )
answer.code:50:2: error: expected ‘;’ at end of input
   50 | }
      |  ^
      |  ;
answer.code:50:2: error: expected ‘}’ at end of input
answer.code:12:11: note: to match this ‘{’
   12 | int main(){
      |           ^