QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#771660#9246. Dominating PointgzyWA 0ms3568kbC++14734b2024-11-22 14:55:562024-11-22 14:55:56

Judging History

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

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

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.