QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#694683#5520. Distance Paritieslin1991122WA 0ms4060kbC++141.1kb2024-10-31 18:27:402024-10-31 18:27:57

Judging History

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

  • [2024-10-31 18:27:57]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4060kb
  • [2024-10-31 18:27:40]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int INF=0x3f3f3f3f;
const int N=5e2+3;
int g[N][N];
int n;
bool f[N][N];
void solve(){
    cin>>n;int cnt=0;
    for(int i=1;i<=n;++i){
        string s;cin>>s;s="#"+s;
        for(int j=1;j<=n;++j){
            g[i][j]=(s[j]=='1'?1:INF);
            f[i][j]=(s[j]=='1');
            cnt+=f[i][j];
        }
    }
    for(int k=1;k<=n;++k)
        for(int i=1;i<=n;++i)
            for(int j=1;j<=n;++j)
                g[i][j]=min(g[i][j],g[i][k]+g[k][j]);
    for(int i=1;i<=n;++i)
        for(int j=1;j<=n;++j)
            if(g[i][j]==INF||g[i][j]%2!=f[i][j]){
                puts("Track Lost");return;
            }
    printf("Pure Memory\n%d\n",cnt/2);
    for(int i=1;i<=n;++i)
        for(int j=i+1;j<=n;++j)
            if(f[i][j])printf("%d %d\n",i,j);
}
int main(){
    int u,v,w,x,y,z;
    // freopen("bridge.in","r",stdin);
    // freopen("bridge.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int T;for(cin>>T;T--;)solve();
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 4060kb

input:

3
3
011
101
110
4
0100
1000
0001
0010
5
01010
10101
01010
10101
01010

output:

Pure Memory
3
1 2
1 3
2 3
Track Lost
Pure Memory
6
1 2
1 4
2 3
2 5
3 4
4 5

result:

wrong answer Token parameter [name=yes/no] equals to "Pure", doesn't correspond to pattern "[yY][eE][sS]|[nN][oO]" (test case 1)