Codeforces Round #294 (Div. 2)B - A and B and Compilation Errors 水题
2 seconds
256 megabytes
standard input
standard output
A and B are preparing themselves for programming contests.
B loves to debug his code. But before he runs the solution and starts debugging, he has to first compile the code.
Initially, the compiler displayed n compilation errors, each of them is represented as a positive integer. After some effort, B managed to fix some mistake and then another one mistake.
However, despite the fact that B is sure that he corrected the two errors, he can not understand exactly what compilation errors disappeared — the compiler of the language which B uses shows errors in the new order every time! B is sure that unlike many other programming languages, compilation errors for his programming language do not depend on each other, that is, if you correct one error, the set of other error does not change.
Can you help B find out exactly what two errors he corrected?
The first line of the input contains integer n (3 ≤ n ≤ 105) — the initial number of compilation errors.
The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the errors the compiler displayed for the first time.
The third line contains n - 1 space-separated integers b1, b2, ..., bn - 1 — the errors displayed at the second compilation. It is guaranteed that the sequence in the third line contains all numbers of the second string except for exactly one.
The fourth line contains n - 2 space-separated integers с1, с2, ..., сn - 2 — the errors displayed at the third compilation. It is guaranteed that the sequence in the fourth line contains all numbers of the third line except for exactly one.
Print two numbers on a single line: the numbers of the compilation errors that disappeared after B made the first and the second correction, respectively.
5
1 5 8 123 7
123 7 5 1
5 1 7
8
123
6
1 4 3 3 5 7
3 7 5 4 3
4 3 7 5
1
3
In the first test sample B first corrects the error number 8, then the error number 123.
In the second test sample B first corrects the error number 1, then the error number 3. Note that if there are multiple errors with the same number, B can correct only one of them in one step.
题意:给你n个数,然后再给你n-1个数,再给你n-2个数
然后问你不见了哪两个数
题解:用sum1,sum2,sum3分别表示这几个数列的和,然后直接加起来就好,然后减去就可以得到答案了
//qscqesze
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 100001
#define eps 1e-9
const int inf=0x7fffffff; //无限大
ll sum1;
ll sum2;
ll sum3;
int main()
{
sum1=;
sum2=;
sum3=;
int n;
cin>>n;
int a;
for(int i=;i<n;i++)
{
cin>>a;
sum1+=a;
}
for(int i=;i<n-;i++)
{
cin>>a;
sum2+=a;
}
for(int i=;i<n-;i++)
{
cin>>a;
sum3+=a;
}
cout<<sum1-sum2<<endl;
cout<<sum2-sum3<<endl;
return ;
}
Codeforces Round #294 (Div. 2)B - A and B and Compilation Errors 水题的更多相关文章
- Codeforces Round #294 (Div. 2)C - A and B and Team Training 水题
C. A and B and Team Training time limit per test 1 second memory limit per test 256 megabytes input ...
- Codeforces Round #310 (Div. 2) A. Case of the Zeros and Ones 水题
A. Case of the Zeros and Ones Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/con ...
- Codeforces Round #624 (Div. 3) A. Add Odd or Subtract Even(水题)
You are given two positive integers aa and bb . In one move, you can change aa in the following way: ...
- Codeforces Round #267 (Div. 2) C. George and Job(DP)补题
Codeforces Round #267 (Div. 2) C. George and Job题目链接请点击~ The new ITone 6 has been released recently ...
- Codeforces Round #430 (Div. 2) 【A、B、C、D题】
[感谢牛老板对D题的指点OTZ] codeforces 842 A. Kirill And The Game[暴力] 给定a的范围[l,r],b的范围[x,y],问是否存在a/b等于k.直接暴力判断即 ...
- Codeforces Round #294 (Div. 2) D. A and B and Interesting Substrings
题意: 对于26个字母 每个字母分别有一个权值 给出一个字符串,找出有多少个满足条件的子串, 条件:1.第一个字母和最后一个相同,2.除了第一个和最后一个字母外,其他的权和为0 思路: 预处理出sum ...
- Codeforces Round #294 (Div. 2)
水 A. A and B and Chess /* 水题 */ #include <cstdio> #include <algorithm> #include <iost ...
- Codeforces Round #294 (Div. 2)D - A and B and Interesting Substrings 字符串
D. A and B and Interesting Substrings time limit per test 2 seconds memory limit per test 256 megaby ...
- Codeforces Round #294 (Div. 2)A - A and B and Chess 水题
A. A and B and Chess time limit per test 1 second memory limit per test 256 megabytes input standard ...
随机推荐
- 如何禁止Linux内核的-O2编译选项【转】
转自:http://blog.csdn.net/larryliuqing/article/details/8674274 http://lenky.info/2013/03/10/%E5%A6%82% ...
- p,br,hn,b,i,u,s,sup,sub标签
<!-- -->注释 <p></p>段落标签 <br />换行标签 <h1></h1> 字体标签 最大 <h6> ...
- 002_curl及postman专题
一. 步骤 1: 下载cURL工具 使用您的Windows机器从cURL web站点下载最新版本的cURL: (1) 通常情况下,多数的Windows用户可以从官网下载页面http://curl.ha ...
- 2->集群架构主机优化流程
集群架构优化流程: 有道笔记分享链接
- 数据科学实战手册(R+Python)书中引用资料网址
本文会持续将<数据科学实战手册(R+Python)>一书中的附带参考资料网址手打出来, 方便访问. 由于书中的参考资料网址太多, 这个文档将可能花费一段时间才能完成. 第一章 P7 Rs ...
- Robots.txt 不让搜索引擎收录网站的方法
有没有担心过自己的隐私会在强大的搜索引擎面前无所遁形?想象一下,如果要向世界上所有的人公开你的私人日记,你能接受吗?的确是很矛盾的问题,站长们大都忧虑“如何让搜索引擎收录的我的网站?”,而我们还是要研 ...
- CCF CSP 201312-4 有趣的数
CCF计算机职业资格认证考试题解系列文章为meelo原创,请务必以链接形式注明本文地址 CCF CSP 201312-4 有趣的数 问题描述 我们把一个数称为有趣的,当且仅当: 1. 它的数字只包含0 ...
- 7-10 守卫棋盘 uva11214
输入要给n*m的棋盘 均小于10 某些格子有标记 用最少的皇后 辐射到所有的标记 限时 6666ms 用IDA* 时间6000 尴尬. #include<bits/stdc++ ...
- EcOS安装
从ubuntu 拷贝到 centos cd /media ls cd ./sf_EcOS 这个目录就是共享目录,名字可能不一样 cp -r studio.zip /home/ 1. 查看版本 cent ...
- 关于JavaScript变量提升
请看如下代码: console.log(a); var a = 2; 输入结果会是什么? 请说出理由 可能会有三种答案: 1.2 2.抛出ReferenceError异常 3.undifined 对 ...