29132023-02-02 22:17:06lazingergoVillanyautócpp17Wrong answer 0/603ms5360 KiB
#include <fstream>
#include <algorithm>

using namespace std;

#define ull unsigned long long
#define ll long long

#define inf "input.txt"
#define outf "output.txt"

#define infile "jeton.in"
#define outfile "jeton.out"



int main()
{

    ifstream fin(infile);
    ofstream fout(outfile);

     int n, m;
    fin >> n >> m;

    int x[28001], y[28001];

    for (int i = 1; i <= n; i++)
        fin >> x[i];

    for (int j = 1; j <= m; j++)
        fin >> y[j];

    int gyakorisag[60000] = { 0 };

    for (int i = 1; i <= n; i++)
        gyakorisag[x[i]]++;
    for (int i = 1; i <= m; i++)
        gyakorisag[y[i]]++;

    int minelem, maxelem;

    for (int i = 1; i <= 60000; i++)
        if (gyakorisag[i] == 2)
        {
            minelem = i;
            break;
        }

    for (int i = 60000; i >= 1; i--)
        if (gyakorisag[i] == 2)
        {
            maxelem = i;
            break;
        }
    fout << minelem << " " << maxelem<< " ";

    for (int i = 1; i <= n; i++)
        if (x[i] >= minelem && x[i] <= maxelem)
            x[i] = 0;

    for (int i = 1; i <= m; i++)
        if (y[i] >= minelem && y[i] <= maxelem)
            y[i] = 0;


    ull ionel = 0;
    for (int i = 1; i <= n; i++)
        if (x[i] > 0)
            ionel++;


    ull georgel = 0;
    for (int i = 1; i <= m; i++)
        if(y[i]>0)
            georgel++;

    if (ionel > georgel)
        fout << 1;
    else if (ionel < georgel)
        fout << 2;
    else
        fout << 0;


	return 0;
}

SubtaskSumTestVerdictTimeMemory
base0/60
1Wrong answer0/03ms2828 KiB
2Wrong answer0/03ms3140 KiB
3Wrong answer0/13ms3240 KiB
4Wrong answer0/13ms3544 KiB
5Wrong answer0/13ms3860 KiB
6Wrong answer0/23ms3992 KiB
7Wrong answer0/23ms4200 KiB
8Wrong answer0/23ms4316 KiB
9Wrong answer0/13ms4632 KiB
10Wrong answer0/13ms4492 KiB
11Wrong answer0/13ms4492 KiB
12Wrong answer0/23ms4808 KiB
13Wrong answer0/23ms4712 KiB
14Wrong answer0/23ms4708 KiB
15Wrong answer0/33ms4856 KiB
16Wrong answer0/33ms4712 KiB
17Wrong answer0/23ms4708 KiB
18Wrong answer0/23ms4708 KiB
19Wrong answer0/23ms4712 KiB
20Wrong answer0/23ms5020 KiB
21Wrong answer0/23ms5224 KiB
22Wrong answer0/23ms5160 KiB
23Wrong answer0/33ms5004 KiB
24Wrong answer0/33ms5008 KiB
25Wrong answer0/33ms5004 KiB
26Wrong answer0/33ms4988 KiB
27Wrong answer0/33ms5244 KiB
28Wrong answer0/33ms5296 KiB
29Wrong answer0/33ms5360 KiB
30Wrong answer0/33ms5140 KiB