QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#371350#7995. 图24bot#WA 2ms5556kbC++171.0kb2024-03-30 08:28:212024-03-30 08:28:22

Judging History

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

  • [2024-03-30 08:28:22]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:5556kb
  • [2024-03-30 08:28:21]
  • 提交

answer

# include <bits/stdc++.h>

using namespace std;

namespace lyre {
  template <typename T>
    constexpr T& cmin(T &a, T const b)
    { return a = min(a, b); }
  constexpr int nmax(600);
  int n;
  int e[nmax][nmax];
  int dis[nmax][nmax];
  bool ans[nmax][nmax];
  void main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for (int i(0); i < n; ++i)
      for (int j(0); j < n; ++j)
        cin >> e[i][j];
    memcpy(dis, e, sizeof dis);
    memset(ans, true, sizeof ans);
    for (int i(0); i < n; ++i)
      ans[i][i] = false;
    for (int k(0); k < n; ++k)
      for (int i(0); i < n; ++i)
        for (int j(0); j < n; ++j) {
          if (i == j || k == i || k == j) continue;
          if (dis[i][k] + dis[k][j] >= dis[i][j]) continue;
          dis[i][j] = dis[i][k] + dis[k][j];
          ans[i][j] = false;
        }
    for (int i(0); i < n; ++i) {
      for (int j(0); j < n; ++j)
        cout << ans[i][j];
      cout << endl;
    }
  }
}

int main() { lyre::main(); }

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 5332kb

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: 5468kb

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: 2ms
memory: 5556kb

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:

0001000000000000000000000000000000000010010100000000100001001100101000000001000000000000000000010010
0011000000100000000001000000100000000000000000000000000000100000000001001000000001000000010000000100
01001000011000000000000000001000000000000000000000001000001011000010010010000000010000000100000001...

result:

wrong answer 1st lines differ - expected: '000000000000000000000000000000...0000001000000000000000000000010', found: '000100000000000000000000000000...0000001000000000000000000010010'