Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <unordered_map>
- using namespace std;
- const int MAXN = 15;
- const int MX_VAL = 1e2;
- int main() {
- freopen("input.txt", "w", stdout);
- freopen("output.txt", "r", stdin);
- int n = rand() % MAXN + 1;
- int m = rand() % MAXN + 1, ans = 0;
- int a[n];
- int b[m];
- unordered_map<int, bool> used;
- cout << n << "\n";
- for (int i = 0; i < n; ++i) {
- a[i] = (rand() % MX_VAL) * (rand() % 2 == 0 ? 1 : -1);
- used[a[i]] = 1;
- cout << a[i] << " ";
- }
- cout << "\n" << m << "\n";
- for (int i = 0; i < m; ++i) {
- b[i] = (rand() % MX_VAL) * (rand() % 2 == 0 ? 1 : -1);
- ans = ans + (used[b[i]]);
- cout << b[i] << " ";
- }
- int ans_solve;
- cin >> ans_solve;
- if (ans != ans_solve) {
- cout << "WA";
- return 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement