Submission #87187

#TimeUsernameProblemLanguageResultExecution timeMemory
87187jvalsortavPreokret (COCI18_preokret)C++14
50 / 50
4 ms544 KiB
#include <cstdio> #include <cstdlib> #include <cmath> #include <iostream> #include <cctype> #include <ctime> #include <set> using namespace std; int a, b, x, br, ba, bb, y; set <int> ak, bk; int aj = 1, bj = 0; int main() { cin >> a; for (int i = 0; i < a; i++){ cin >> x; ak.insert(x); if (x <= 1440) br++; } cin >> b; for (int i = 0; i < b; i++){ cin >> x; bk.insert(x); if (x <= 1440) br++; } x = *ak.begin(); y = *bk.begin(); if (x > y){ /*ba++; ak.erase(x);*/ } else{ /*bb++; bk.erase(y);*/ aj = 0; bj = 1; } y = 0; for (int i = 0; i < 2880; i++){ if (ak.count(i)) ba++; if (bk.count(i)) bb++; if (aj){ if (ba < bb){ aj = 0; bj = 1; y++; } } if (bj){ if (bb < ba){ aj = 1; bj = 0; y++; } } } cout << br << endl << y-1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...