/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 9ms 560.0 KiB
#3 Accepted 9ms 332.0 KiB
#4 Accepted 3ms 540.0 KiB
#5 Accepted 15ms 540.0 KiB
#6 Accepted 17ms 584.0 KiB
#7 Accepted 16ms 564.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;

void solve() {
    int n, m; cin >> n >> m;
    unordered_set<int> a, b; 
    for(int i = 0; i < n; i++) {
        int x; cin >> x;
        if(x < 4)
            a.insert(x);
    }
    
    for(int i = 0; i < m; i++) {
        int x; cin >> x;
        b.insert(x);
    }
    
    
    bool ans = (b.size() == 10 and a.size() == 4);
    
    cout << ((ans) ? "YES\n" : "NO\n");
}

int main() {
    ios::sync_with_stdio(false);    
    cin.tie(nullptr);cout.tie(nullptr);

    int t; cin >> t;
    while(t--)
        solve();
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1153 Is Date Possible?
Language
C++17 (G++ 13.2.0)
Submit At
2025-01-03 18:35:26
Judged At
2025-01-03 18:35:26
Judged By
Score
100
Total Time
17ms
Peak Memory
584.0 KiB