/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 11ms 568.0 KiB
#3 Accepted 9ms 436.0 KiB
#4 Accepted 3ms 560.0 KiB
#5 Accepted 16ms 532.0 KiB
#6 Accepted 16ms 532.0 KiB
#7 Accepted 16ms 532.0 KiB

Code

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

void solve() {
    int n, m; cin >> n >> m;
    set<int> a, b; 
    for(int i = 0; i < n; i++) {
        int x; cin >> x;
        if(x > 0 && x < 4)
            a.insert(x);
    }
    
    for(int i = 0; i < m; i++) {
        int x; cin >> x;
        if(x != 0)
            b.insert(x);
    }
    
    bool ans = (b.size() == 9 and a.size() == 3);
    
    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:27:30
Judged At
2025-01-03 18:27:30
Judged By
Score
80
Total Time
16ms
Peak Memory
568.0 KiB