QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#765533#9246. Dominating Pointszy10010#WA 0ms6176kbC++231.6kb2024-11-20 14:34:482024-11-20 14:34:48

Judging History

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

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

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;
	}
	vector<int>res;
	_rep(i,1,n)
	{
		bool bl=true;
		bitset<N>b1(hang[i]);
		int x=rand()%(n/10+1);
		for(int k=1;k<=x;k++)
		{
			for(int j=k;j<=n;j+=x)
			{
				if(i==j)continue;
				bitset<N>b2(lie[j]);
				if((b1&b2).any());
	//				cout<<"1";
				else if(g[i][j]=='0')
				{
					bl=false;
					break;
				}
			}
			if(!bl)break;
		}
		if(bl)res.pb(i);
		if(res.size()>=3)break;
	}
	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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 6176kb

input:

6
011010
000101
010111
100001
010100
100010

output:

1 2 3

result:

wrong answer Wrong Answer, Point not dominating.