QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#725203 | #9246. Dominating Point | yld | WA | 0ms | 3540kb | C++20 | 1.3kb | 2024-11-08 16:39:54 | 2024-11-08 16:39:55 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 5010;
inline int read () {
int w = 1, s = 0; char ch = getchar();
for (; ! isdigit(ch); ch = getchar()) if (ch == '-') w = - 1;
for (; isdigit(ch); ch = getchar()) s = (s << 1) + (s << 3) + (ch ^ 48);
return s * w;
}
void solve () {
int n;cin>>n;
vector <string> s(n);
for(int i=0;i<n;i++) cin>>s[i];
vector<int> ans;
for(int i=0;i<n;i++)
{
int sum=0;
for(int j=0;j<n;j++)
{
if(i==j) continue;
if(s[i][j]=='1'){sum++;continue;}
bool ok=0;
for(int k=0;k<n;k++)
{
if(s[i][k]=='1' && s[k][j]=='1')
{
sum++;
ok=1;
break;
}
}
if(!ok) break;
}
if(sum==n-1)
{
ans.push_back(i);
if(ans.size()==3) break;
}
}
if(ans.size()<3) cout<<"NOT FOUND";return;
for(auto x:ans) cout<<x+1<<" ";
}
signed main () {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int TT = 1;
// TT = read ();
while (TT --) solve ();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3540kb
input:
6 011010 000101 010111 100001 010100 100010
output:
result:
wrong output format Unexpected end of file - int32 expected