UCF “Practice” Local Contest — Aug 25, 2018 Boots Exchange 水题

#include <bits/stdc++.h>
using namespace std;

int n;
set <int> a;
map <int,int> cnt;

int main()
{
    cin >> n; int ans = 0;
    for (int i = 1; i <= n; ++i)
    {
        int x; cin >> x;
        a.insert(x);
        ++cnt[x];
    }
    for (int i = 1; i <= n; ++i)
    {
        int x; cin >> x;
        if(a.count(x) && cnt[x]) --cnt[x];
        else ans++;
    }
    cout << ans << endl;
    return 0;
}

原文地址:https://www.cnblogs.com/2aptx4869/p/12636603.html

时间: 2024-07-30 14:00:29

UCF “Practice” Local Contest — Aug 25, 2018 Boots Exchange 水题的相关文章

UCF “Practice” Local Contest — Aug 25, 2018 Call Me Maybe

根据题意模拟 #include <bits/stdc++.h> #define ull unsigned long long #define P pair<int, int> #define sc(n) scanf("%d", &n) using namespace std; const int p = 131; int n, m, tot, w[100005]; vector<P> ve[100005]; map<ull, int&g

UCF “Practice” Local Contest — Aug 25, 2018 Rummy Score

数据范围很小,搜索即可 #include<bits/stdc++.h> #define sc(n) scanf("%d",&n) #define ll long long #define db double #define P pair<int,int> using namespace std; int a[14], ans, v[14]; void dfs(int k, int tot, int kind, int cnt, int tott, int

UCF Practice Local Contest 2018 (practice)Rummy Score (dfs)

dfs,对于每个点数的牌,都有:不出.作为同花出.作为顺子出这三种选择 #include<bits/stdc++.h> using namespace std; int a[20],x,anss=0x3f3f3f3f; void dfs(int k) { if(k>13) { int sum=0; for(int i=1;i<=13;i++) { sum+=a[i]*i; } anss=min(anss,sum); return; } if(a[k]==0) { return df

2018高考数学真题权威专家评析+2019备考方向解读

2018高考数学真题汇总!权威专家评析+2019备考方向解读 "试卷稳中求新,在保持结构总体稳定基础上,科学灵活地确定试题内容,强调数学应用,突出关键能力."教育部考试中心命题专家认为,2018年高考数学卷一个突出的特点是,根据文理科考生数学素养综合要求,调整文理科同题比例,为新一轮高考数学不分文理科的改革进行了积极探索. 探索内容改革,助推素质教育 教育部考试中心命题专家介绍,根据文理科考生数学素养的综合要求,调整全国Ⅱ卷.全国Ⅲ卷文理科同题比例,为新一轮高考数学不分文理科改革进行了

2018阿里巴巴在线编程题

在其他博客上看到一道 "2018阿里巴巴在线编程题" 我记得题目大概是这样的:输入数据n(n>=6)代表n个数,从0-9任意输入n个数,然后在n个数选出6个数xx-xx-xx表示 时:分:秒,求出最小时间和最大时间,若时间无效,则输出时间无效,例如: 输入: 6 6 5 4 3 2 1 输出: 123456 235641 输入: 6 9 9 9 9 9 9 输出: 时间无效 看着有点意思,就自己做了一遍,输出格式自己美化了一下,没有严格按照题目要求.代码如下: def find_

2018 China Collegiate Programming Contest Final (CCPC-Final 2018)(A B G I L)

A:签到题,正常模拟即可. 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn = 1e5 + 5; 4 struct node{ 5 int id, time; 6 }; 7 node a[maxn]; 8 bool cmp(const node &a, const node &b){ 9 if(a.id^b.id) return a.id < b.id; 10 else return a.

IFE百度前端技术学院4/25/2018(2)

table: table 元素 用来表示超过一维的数据 caption 元素 表示所处的 table 的标题 当所处的 table 是外部 figure 元素的唯一子元素,应首选 figcaption tbody, thead, tfoot 元素 均为一组表格行 thead 表示列头 (通常为列标题,单元格用 th 元素) tfoot 表示列脚 (通常为列数据汇总) col, colgroup, tr 元素 列,列组,行 td, th 元素 td - 数据单元格 th - 标题单元格 th 的 

比赛-CioCio的训练赛 (Aug 18, 2018)

1.) wjj 的子集序列 暴力二进制枚举子集打表,然后可以发现答案就是最大值.根据公式推一波也行吧-- #include <cstdio> #include <stack> #include <ctype.h> using namespace std; typedef long long ll; template<typename T> void rd(T &num) { char tt; bool flag = 0; while (!isdigi

比赛-模拟赛 (Aug 18, 2018)

1.) 小X的质数 线性筛就可以了.由唯一分解定理,如果 $ x = p_a \cdot p_b $ ,那么 \(x\) 也一定只能这样分解质因数.所以 \(x\) 也是符合题目条件的数. #include <cstdio> #include <ctype.h> #include <stack> using namespace std; template<typename T> void rd(T &num) { char tt; while (!i