QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#692318 | #5520. Distance Parities | operator_ | WA | 0ms | 3904kb | C++14 | 1.2kb | 2024-10-31 14:18:50 | 2024-10-31 14:19:15 |
Judging History
answer
//Date: 2024-10-31 08:33:14
#include<bits/stdc++.h>
using namespace std;
#define int long long
inline int rd() {
int s=0,m=0;char ch=getchar();
while(!isdigit(ch)) {if(ch=='-')m=1;ch=getchar();}
while( isdigit(ch)) s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
return m?-s:s;
}
bool MBE;
namespace SOLVER {
const int inf=1e18;
int n,g[505][505];char s[505][505];
void MAIN() {
cin>>n;for(int i=1;i<=n;i++) scanf("%s",s[i]+1);
for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) g[i][j]=s[i][j]=='1'?1:(i==j?0:inf);
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/10||g[i][j]%2!=s[i][j]-'0') {puts("Track Lost");return;}
puts("Pure Memory");int m=0;
for(int i=1;i<=n;i++) for(int j=1;j<i;j++) if(s[i][j]=='1') m++;
cout<<m<<endl;
for(int i=1;i<=n;i++) for(int j=1;j<i;j++) if(s[i][j]=='1') printf("%lld %lld\n",i,j);
}
}
bool MED;
signed main() {
for(int tt=rd();tt;tt--) SOLVER::MAIN();
cerr<<(&MBE-&MED)/1024<<" KB, "<<1000*clock()/CLOCKS_PER_SEC<<" ms\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3904kb
input:
3 3 011 101 110 4 0100 1000 0001 0010 5 01010 10101 01010 10101 01010
output:
Pure Memory 3 2 1 3 1 3 2 Track Lost Pure Memory 6 2 1 3 2 4 1 4 3 5 2 5 4
result:
wrong answer Token parameter [name=yes/no] equals to "Pure", doesn't correspond to pattern "[yY][eE][sS]|[nN][oO]" (test case 1)