QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#725203#9246. Dominating PointyldWA 0ms3540kbC++201.3kb2024-11-08 16:39:542024-11-08 16:39:55

Judging History

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

  • [2024-11-22 18:38:25]
  • hack成功,自动添加数据
  • (/hack/1238)
  • [2024-11-08 16:39:55]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3540kb
  • [2024-11-08 16:39:54]
  • 提交

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