QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#771660 | #9246. Dominating Point | gzy | WA | 0ms | 3568kb | C++14 | 734b | 2024-11-22 14:55:56 | 2024-11-22 14:55:56 |
Judging History
answer
#include<bits/stdc++.h>
#define pb emplace_back
using namespace std;
using ll = long long;
const int N = 5e3 + 7;
int i, j, k, n, m, c[N];
bitset<N> f[N];
vector<int> d, v;
signed main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n;
for(i = 1; i <= n; i++) {
string s; cin >> s;
bitset<N> u(s);
f[i] = u;
d.pb(i), c[i] = f[i].count();
}
sort(d.begin(), d.end(), [](int x, int y) {return c[x] > c[y];});
for(int x : d) {
int g = 1;
for(int y : v) {
if((f[y] & f[x]) == f[y]) {
g = 0;
break;
}
}
if(g) v.pb(x);
if(v.size() == 3) break;
}
if(v.size() < 3) cout << "NOT FOUND";
else cout << v[0] << " " << v[1] << " " << v[2];
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3568kb
input:
6 011010 000101 010111 100001 010100 100010
output:
3 1 2
result:
wrong answer Wrong Answer, Point not dominating.