QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#765412 | #9246. Dominating Point | szy10010# | WA | 1ms | 5932kb | C++23 | 1.5kb | 2024-11-20 14:13:59 | 2024-11-20 14:14:00 |
Judging History
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;
_rep(j,1,m)
{
bitset<N>b1(hang[i]);
bitset<N>b2(lie[j]);
if(!(b1&b2).any())
{
if(g[i][j]=='0')
{
bl=false;
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;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 5932kb
input:
6 011010 000101 010111 100001 010100 100010
output:
NOT FOUND
result:
wrong output format Expected integer, but "NOT" found