QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#458591#8830. Breaking Baducup-team3678#WA 323ms3920kbC++141018b2024-06-29 17:56:132024-06-29 18:00:51

Judging History

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

  • [2024-06-29 18:00:51]
  • 评测
  • 测评结果:WA
  • 用时:323ms
  • 内存:3920kb
  • [2024-06-29 17:56:13]
  • 提交

answer

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;

const int N = 1005;

int a[N][N], p[N];

signed main() {
    int n; scanf("%d", &n);
    for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) {
        scanf("%d", &a[i][j]);
    }
    for (int j = 1; j <= n; ++j) p[j] = j;
    mt19937 rnd(13137);
    double now = clock();
    register bool b[30];
    while (clock() - now < 0.93 * CLOCKS_PER_SEC) {
        shuffle(p + 1, p + n + 1, rnd);
        int S = 0;
        for (register int j = 1; j <= n; ++j) S += a[j][p[j]];
        S = S % 5 + 10;
        b[S] = 1;
        for (register int j = 1; j <= n; ++j) {
            for (register int k = j + 1; k <= n; ++k) {
                b[S - a[j][p[j]] - a[k][p[k]] + a[j][p[k]] + a[k][p[j]]] = 1;
            }
        }
    }
    for (int i = 0; i < 5; ++i) {
        bool t = 0;
        for (int j = i; j < 30; j += 5) t |= b[j];
        putchar("NY"[t]);
    }
    puts("");
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 323ms
memory: 3920kb

input:

2
0 4
4 0

output:


result:

wrong answer 1st words differ - expected: 'YNNYN', found: '