当前位置:网站首页>【集训Day3】delete
【集训Day3】delete
2022-07-26 16:55:00 【SSL_GYX】
delete

解题思路
若第二行或第三行没有出现某个数字,那么另外包含这个数字的列一定要删掉,暴力枚举操作即可。
code
#include<iostream>
#include<cstdio>
using namespace std;
int n;
int a[100010];
int b[100010];
int c[100010];
int v[100010];
int s1[100010];
int s2[100010];
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
scanf("%d",&a[i]);
for(int i=1;i<=n;i++)
scanf("%d",&b[i]),s1[b[i]]++;
for(int i=1;i<=n;i++)
scanf("%d",&c[i]),s2[c[i]]++;
int flg=1,ans=0;
while(flg)
{
flg=0;
for(int i=1;i<=n;i++)
if(!v[i]&&(!s1[a[i]]||!s2[a[i]]||!s2[b[i]]||!s1[c[i]]))
v[i]=1,s1[b[i]]--,s2[c[i]]--,flg=1,ans++;
}
cout<<ans<<endl;
}
边栏推荐
- In depth exploration of ribbon load balancing
- MySQL foundation - basic database operation
- Oracle is slow to perform a large number of DML operations. Is it the problem of CPU or hard disk?
- uni-app
- Just this time! Talk about the technical solutions of distributed system in detail
- Week 16 OJ practice 1 calculates the day of the year
- 【云原生】 iVX 低代码开发 引入腾讯地图并在线预览
- 即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战
- Ascend target detection and recognition - customize your own AI application
- Is it safe to open an account online now? Who do you want to open a stock account?
猜你喜欢

图解用户登录验证流程,写得太好了!

Application of machine vision in service robot

敏捷开发与DevOps的对比

图的遍历的定义以及深度优先搜索和广度优先搜索(一)

GAN (Generative Adversarial Network,GAN)生成式对抗网络
![[300 opencv routines] 240. Shi Tomas corner detection in opencv](/img/3a/0b81fb06e91e681ccc928e67297188.png)
[300 opencv routines] 240. Shi Tomas corner detection in opencv

Gan (generative adversarial network, GaN) generative countermeasure network

CCS TM4C123新建工程

leetcode:1206. 设计跳表【跳表板子】

JS 递归 斐波那契数列 深克隆
随机推荐
现在网上开户安全么?股票开户要找谁?
Eureka Registry - from entry to application
如何快速使用 ELisp 进行插件编写
使用 Dired 快速移动文件
6-19漏洞利用-nsf获取目标密码文件
OpenWrt之feeds.conf.default详解
Advantages of time series database and traditional database
CCS TM4C123新建工程
图解用户登录验证流程,写得太好了!
【模板】线段树 1
uni-app
Everything is available Cassandra: the fairy database behind Huawei tag
[300 opencv routines] 240. Shi Tomas corner detection in opencv
Mount NFS storage
Is it safe for Huishang futures to open an account online? What is the account opening process?
带你熟悉云网络的“电话簿”:DNS
What kind of product is the Jetson nano? (how about the performance of Jetson nano)
Summer Challenge openharmony greedy snake based on JS
The diagram of user login verification process is well written!
重磅公布!ICML2022奖项:15篇杰出论文,复旦、厦大、上交大研究入选