QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#765375#9246. Dominating Pointszy10010#TL 1ms6176kbC++231.6kb2024-11-20 14:05:222024-11-20 14:05:23

Judging History

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

  • [2024-11-22 18:38:25]
  • hack成功,自动添加数据
  • (/hack/1238)
  • [2024-11-20 14:05:23]
  • 评测
  • 测评结果:TL
  • 用时:1ms
  • 内存:6176kb
  • [2024-11-20 14:05:22]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define u1 (u<<1)
#define u2 (u<<1|1)
#define pb push_back
#define pp pop_back()
#define int long long
#define laile cout<<"laile"<<endl
#define lowbit(x) ((x)&(-x))
#define double long double
#define sf(x) scanf("%lld",&x)
#define sff(x,y) scanf("%lld %lld",&x,&y)
#define sd(x) scanf("%Lf",&x)
#define sdd(x,y) scanf("%Lf %Lf",&x,&y)
#define _for(i,n) for(int i=0;i<(n);++i)
#define _rep(i,a,b) for(int i=(a);i<=(b);++i)
#define _pre(i,a,b) for(int i=(a);i>=(b);--i)
#define all(x) (x).begin(), (x).end()
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef unsigned long long ULL;
typedef pair<int,int>PII;
const int N=5050,INF=4e18;
int n,m;
char g[N][N];
char g2[N][N];
string hang[N],lie[N];
void solve()
{
	cin>>n;
	m=n;
	_rep(i,1,n)
	{
		string now="";
		_rep(j,1,m)
			cin>>g[i][j],now.pb(g[i][j]);
		hang[i]=now;
	}
	_rep(j,1,m)
	{
		string now="";
		_rep(i,1,n)
			now.pb(g[i][j]);
		lie[j]=now;
	}
	_rep(i,1,n)
	{
		_rep(j,1,m)
		{
			bitset<N>b1(hang[i]);
			bitset<N>b2(lie[j]);
			if((b1&b2).count())g2[i][j]='1';
			else g2[i][j]='0';
		}
	}
	vector<int>res;
	_rep(i,1,n)
	{
		bool bl=true;
		_rep(j,1,m)
		{
			if(j==i)continue;
			if(g[i][j]=='0'&&g2[i][j]=='0')
			{
				bl=false;
				break;
			}
		}
		if(bl)res.pb(i);
	}
	if(res.size()<3)cout<<"NOT FOUND\n";
	else 
		cout<<res[0]<<" "<<res[1]<<" "<<res[2]<<'\n';
	return ;
}
signed main()
{
	IOS;
	int T=1;
//	cin>>T;
	while(T--)
		solve();
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 6016kb

input:

6
011010
000101
010111
100001
010100
100010

output:

1 3 4

result:

ok OK, Answer correct.

Test #2:

score: 0
Accepted
time: 1ms
memory: 6176kb

input:

3
011
001
000

output:

NOT FOUND

result:

ok OK, Answer correct.

Test #3:

score: 0
Accepted
time: 1ms
memory: 5948kb

input:

3
010
001
100

output:

1 2 3

result:

ok OK, Answer correct.

Test #4:

score: -100
Time Limit Exceeded

input:

4994
0100001010011001010101110010101000111101111100100001110010000111100000000100110100101000001010100000010010010110110110111010010010100110100000110110111001010111010111010111011001000101001000010001010111110000000100001100000111100011001010010111011100111010101110011000010111101011111110001111110...

output:


result: