/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 768.0 KiB
#2 Accepted 13ms 532.0 KiB
#3 Accepted 10ms 532.0 KiB
#4 Accepted 3ms 764.0 KiB
#5 Accepted 17ms 532.0 KiB
#6 Accepted 17ms 532.0 KiB
#7 Accepted 17ms 532.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
 
const int N = 3e5 + 9;
using ll = long long;
 
void solve() {
  int n, m ; cin >> n >> m;
  set <int> s1, s2;
  for(int i=0; i<n; i++) {
    int e; cin >> e;
    s1.insert(e);
  }
  for(int i=0; i<m; i++) {
    int e; cin >> e;
    s2.insert(e);
  }
  
  // for(auto u : s1) cout << u << ' ';
  // cout << endl;
  // for(auto u : s2) cout << u << ' ';
  // cout << endl;

  if(binary_search(s1.begin(), s1.end(), 0) && binary_search(s1.begin(), s1.end(), 1) && binary_search(s1.begin(), s1.end(), 2) && binary_search(s1.begin(), s1.end(), 3) && s2.size() == 10) {
     cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }


  
}
 
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  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 15:00:34
Judged At
2025-01-02 15:00:34
Judged By
Score
100
Total Time
17ms
Peak Memory
768.0 KiB