QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#458591 | #8830. Breaking Bad | ucup-team3678# | WA | 323ms | 3920kb | C++14 | 1018b | 2024-06-29 17:56:13 | 2024-06-29 18:00:51 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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: '