当前位置:网站首页>[51nod p3058] Xiao ming'ai set [set]
[51nod p3058] Xiao ming'ai set [set]
2022-06-13 09:35:00 【Ayane.】
analysis :
Similarity degree = = = Same number of elements / / / Total elements use s e t set set You can find the number of different elements
CODE:
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<set>
#define reg register
using namespace std;
typedef long long ll;
int T,n,m;
set<int> a;
int main(){
scanf("%d",&T);
while(T--)
{
a.clear();
scanf("%d%d",&n,&m);
for(reg int i=1,x;i<=n+m;i++)
{
scanf("%d",&x);
a.insert(x);
}
int len=a.size();
printf("%d\n",(n+m-len)*100/len);
}
return 0;
}
边栏推荐
- Class and object -- friend
- Heap
- A static variable is associated with a class and can be used as long as the class is in memory (the variable does not exist as long as your application terminates). (heap body, stack reference)
- Simple use of spiel expressions
- LeetCode 322. 零钱兑换
- VDD,DVDD,AVDD,VCC,AFVDD,DOVDD,IOVDD
- Trees and binary trees: traversal of binary trees
- Zigzag transformation
- C language: Address Book
- Acwing785. quick sort (sort+ quick sort + merge sort)
猜你喜欢
VGA common resolution and calculation method
BGP Federation +community
Storage mode of drawings
C language: file operation
Jenkins access openldap user authentication
Jenkins接入Openldap用户认证
C language: five custom types
C language: deep understanding of character functions and string functions (2)
Jenkins接入Openldap用戶認證
Acwing 787. Merge sort
随机推荐
LeetCode 6098. 统计得分小于 K 的子数组数目(前缀和+二分查找)
LeetCode 583. 两个字符串的删除操作
LeetCode 202. Happy number
攻防世界-PWN-shell
Solov2 nanny level tutorial (including environment configuration, training your own data set, code logic analysis, etc...) Updating ing
LeetCode 6098. Count the number of subarrays whose score is less than K (prefix and + binary search)
Classes and objects -- encapsulation
Summary of string, vector and array learning
谨记! 写代码别太自信! 一定要写点关键日志info输出,不然问题都定位不到。
Leetcode points to offer 30 Stack containing min function
LeetCode 6096. 咒语和药水的成功对数(二分查找)
Batch read all voice files under the folder
Exercise 8-3 rotate the array to the right (20 points)
LeetCode 6095. 强密码检验器 II
JS【中高级】部分的知识点我帮你们总结好了
LeetCode 201. 数字范围按位与
Solov2 source code analysis
Online debugging tool Arthas Foundation
C language: data storage in memory
(dfs+ tree DP) acwing 846 Center of gravity of tree