Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, m;
cin >> n >> m;
set<int> v, s;
for (int i = 0; i < n; i++) {
int a;
cin >> a;
v.insert(a);
}
for (int i = 0; i < m; i++) {
int p;
cin >> p;
s.insert(p);
}
bool common_found = false;
for (int x : v) {
if (s.find(x) != s.end()) {
common_found = true;
break;
}
}
if (common_found)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1153 Is Date Possible?
- Contest
- Happy New Year 2025
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-01-02 14:59:06
- Judged At
- 2025-01-02 14:59:06
- Judged By
- Score
- 0
- Total Time
- 21ms
- Peak Memory
- 532.0 KiB