QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#791860 | #9246. Dominating Point | xiaolei338 | WA | 0ms | 5704kb | C++20 | 1.2kb | 2024-11-28 21:25:22 | 2024-11-28 21:25:23 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const int N = 2e5 + 10, mod = 998244353, INF = 0x3f3f3f3f;
random_device rd;
mt19937_64 rng(rd());
LL n, m;
// LL a[N];
bitset<5000> a[5010], b[5010];
void solve()
{
cin >> n;
for(int i = 0; i < n; i ++)
{
for(int j = 0; j < n; j ++)
{
char c;
cin >> c;
if(c == '1')a[i][j] = b[i][j] = 1;
}
}
vector<int> ans;
for(int i = 0; i < n; i ++)
{
for(int j = 0; j < n; j ++)
{
if(i == j)continue;
if(a[i][j])continue;
if((a[i] & b[j]).any())continue;
ans.push_back(i);
break;
}
if(ans.size() >= 3)continue;
}
if(ans.size() < 3)cout << "NOT FOUND\n";
else{
for(int i = 0; i < 3; i ++)cout << ans[i] + 1 << ' ';
cout << '\n';
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
LL _T = 1;
// cin >> _T;
while(_T --)
{
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 5704kb
input:
6 011010 000101 010111 100001 010100 100010
output:
1 2 4
result:
wrong answer Wrong Answer, Point not dominating.