519B Codeforces
A and B and compilation Errors
Solution in c++
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
int main()
{
long e,t;
scanf("%ld",&e);
vector<long> initial(e),first(e-1),second(e-2),out(1);
for(long i=0;i<initial.size();i++)scanf("%ld", &initial[i]);
for(long i=0;i<first.size();i++)scanf("%ld",&first[i]);
for(long i=0;i<second.size();i++)scanf("%ld",&second[i]);
sort(initial.begin(), initial.end());
sort(first.begin(), first.end());
sort(second.begin(), second.end());
std::set_difference(initial.begin(), initial.end(), first.begin(), first.end(), out.begin());
std::set_difference(first.begin(), first.end(), second.begin(), second.end(), &out[1]);
printf("%ld \n%ld\n", out[0], out[1]);
return 0;
}
0 التعليقات:
إرسال تعليق