QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#657307#9246. Dominating PointVegetog#WA 1ms5560kbC++201.1kb2024-10-19 14:32:442024-10-19 14:32:55

Judging History

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

  • [2024-11-22 18:38:25]
  • hack成功,自动添加数据
  • (/hack/1238)
  • [2024-10-19 14:32:55]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5560kb
  • [2024-10-19 14:32:44]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
using ll =long long;
const int N=5000+6;

char a[N][N];
int b[N][N];

void solve()
{
    int n;cin>>n;
    vector<vector<int>> g(n+1);
    vector<vector<int>> h(n+1);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            cin>>a[i][j];
            if(a[i][j]=='1'){
                g[i].push_back(j);
            }
        }
    }

    for(int i=1;i<=n;i++){
        for(auto it : g[i]){
            for(auto jt : g[it]){
                h[i].push_back(jt);
                b[i][jt]=it;
            }
        }
    }

    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(i==j) continue;
            if(a[i][j]=='1'&&b[j][i]>0){
                cout<<i<<" "<<j<<" "<<b[j][i]<<"\n";
                return ;
            }
        }
    }
    cout<<"NOT FOUND"<<"\n";
}

signed main(){
    ios::sync_with_stdio(0);
    cin.tie(nullptr),cout.tie(nullptr);

    int T=1;
    // cin>>T;
    while(T--){
        solve();
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 5560kb

input:

6
011010
000101
010111
100001
010100
100010

output:

1 2 6

result:

wrong answer Wrong Answer, Point not dominating.