QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#657307 | #9246. Dominating Point | Vegetog# | WA | 1ms | 5560kb | C++20 | 1.1kb | 2024-10-19 14:32:44 | 2024-10-19 14:32:55 |
Judging History
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.