QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#458351#8779. Square of Trianglesucup-team3678Compile Error//C++141.2kb2024-06-29 16:47:352024-06-29 16:47:38

Judging History

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

  • [2024-06-29 16:47:38]
  • 评测
  • [2024-06-29 16:47:35]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int p[4][3], id[4], q[4][3];

void chk(int &T) {
    if (q[0][0] == q[]) {
        T = 1;
    }
}

signed main() {
    int T; scanf("%d", &T);
    while (T--) {
        for (int i = 0; i < 4; ++i) {
            for (int j = 0; j < 3; ++j) {
                scanf("%d", &p[i][j]);
            }
            sort(p[i], p[i] + 3);
        }
        iota(id, id + 4, 0);
        int flg = 0;
        do {
            for (int i = 0; i < 4; ++i)
            for (int j = 0; j < 3; ++j) {
                q[i][j] = p[id[i]][j];
            }
            do {
                sort(q[1], q[1] + 3);
                do {
                    sort(q[2], q[2] + 3);
                    do {
                        sort(q[3], q[3] + 3);
                        do {
                            chk(flg);
                        } while (next_permutation(q[3], q[3] + 3));
                    } while (next_permutation(q[2], q[2] + 3));
                } while (next_permutation(q[1], q[1] + 3));
            } while (next_permutation(q[0], q[0] + 3));
        } while (next_permutation(id, id + 4) && !flg);
        printf("%d\n", flg);
    }
    return 0;
}

Details

answer.code: In function ‘void chk(int&)’:
answer.code:8:22: error: expected primary-expression before ‘]’ token
    8 |     if (q[0][0] == q[]) {
      |                      ^
answer.code: In function ‘int main()’:
answer.code:14:17: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |     int T; scanf("%d", &T);
      |            ~~~~~^~~~~~~~~~
answer.code:18:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   18 |                 scanf("%d", &p[i][j]);
      |                 ~~~~~^~~~~~~~~~~~~~~~