当前位置:网站首页>【集训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;
}
边栏推荐
- JS function scope variables declare that the variables that promote the scope chain without VaR are global variables
- Is it really safe and reliable to exempt five in case of opening an account in a stock company
- VS Code 格式化后 自动让函数名后有空格
- 【OpenCV 例程 300篇】240. OpenCV 中的 Shi-Tomas 角点检测
- pip安装模块,报错
- 6-19漏洞利用-nsf获取目标密码文件
- 我们被一个 kong 的性能 bug 折腾了一个通宵
- The diagram of user login verification process is well written!
- Use dired to move files quickly
- Chuan Hejing technology's mainland factory was invaded by a virus, and the whole line was shut down!
猜你喜欢

第16周OJ实践1 计算该日在本年中是第几天

The user experience center of Analysys Qianfan bank was established to help upgrade the user experience of the banking industry

6-19漏洞利用-nsf获取目标密码文件

Just this time! Talk about the technical solutions of distributed system in detail

天翼云Web应用防火墙(边缘云版)支持检测和拦截Apache Spark shell命令注入漏洞

kudu设计-tablet

# MySQL 七种连接方式图解
![Leetcode:1206. design jump table [jump table board]](/img/4f/2b6df8e2151b8bce70c8227c69d8bc.png)
Leetcode:1206. design jump table [jump table board]

RedisDesktopManager去除升级提示

一文详解吞吐量、QPS、TPS、并发数等高并发指标
随机推荐
Is the rolling update of pod similar to Canary deployment or blue-green deployment?
Tree DP problem
国际象棋机器人夹断7岁男孩手指,原因是「棋手违反安全规则」?
Week 4 Recurrent Neural Networks
Ascend target detection and recognition - customize your own AI application
Asemi rectifier bridge kbpc2510, kbpc2510 parameters, kbpc2510 specifications
SQL injection (mind map)
Leetcode:1206. design jump table [jump table board]
Concepts and differences of DQL, DML, DDL and DCL
机器学习-什么是机器学习、监督学习和无监督学习
Detailed explanation of openwrt's feeds.conf.default
Pay attention to the traffic safety warning of tourism passenger transport issued by the Ministry of public security
uni-app
大家下午好,请教一个问题:如何从保存点启动一个之前以SQL提交的作业?问题描述:用SQL在cl
得不偿失!博士骗领210万元、硕士骗领3万元人才补贴,全被判刑了!
Avalanche subnets vs. polygon supernets of application chain
解决哈希冲突的几种方式
Comparison between agile development and Devops
2022 年有哪些流行的技术?
Chuan Hejing technology's mainland factory was invaded by a virus, and the whole line was shut down!