QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#296829 | #7995. 图 | Heltion# | WA | 3ms | 3612kb | C++20 | 903b | 2024-01-03 17:52:53 | 2024-01-03 17:52:53 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#define debug(...) 417
#endif
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
cout << fixed << setprecision(20);
int n;
cin >> n;
vector a(n, vector<int>(n));
for (int i = 0; i < n; i += 1) {
for (int j = 0; j < n; j += 1) { cin >> a[i][j]; }
}
auto d = a;
for (int k = 0; k < n; k += 1) {
for (int i = 0; i < n; i += 1) {
for (int j = 0; j < n; j += 1) {
d[i][j] = min(d[i][j], d[i][k] + a[k][j]);
}
}
}
for (int i = 0; i < n; i += 1) {
for (int j = 0; j < n; j += 1) {
bool ok = i != j and d[i][j] == a[i][j];
for (int k = 0; k < n; k += 1) {
if (k != i and k != j and d[i][k] + d[k][j] == d[i][j]) {
ok = false;
}
}
cout << ok;
}
cout << "\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3540kb
input:
4 0 3 2 100 3 0 8 100 2 8 0 10 100 100 10 0
output:
0110 1000 1001 0010
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
4 0 3 2 100 3 0 8 100 2 8 0 10 100 100 10 0
output:
0110 1000 1001 0010
result:
ok 4 lines
Test #3:
score: -100
Wrong Answer
time: 3ms
memory: 3612kb
input:
100 0 41659 61282 49636 67326 48035 29694 46438 87384 82143 38685 66540 48746 29800 91786 54931 56232 61941 53423 75707 45135 69244 53802 89998 64199 63778 75825 31745 66975 44537 35793 55663 72647 60768 80884 46657 54066 84568 6266 48213 78216 50369 66761 54861 67607 38509 52250 54210 71135 56840 5...
output:
0000000000000000000000000000000000000010000100000000100001001000000000000001000000000000000000000010 0011000000100000000000000000000000000000000000000000000000100000000000000000000000000000000000000000 01001000010000000000000001000000000000000000000000001000000010000000000010000000010000000001000000...
result:
wrong answer 3rd lines differ - expected: '010010000100000000000000000000...0001000000001000000000000000000', found: '010010000100000000000000010000...0001000000001000000000100000000'