/ SeriousOJ /

Record Detail

Compile Error

foo.cc: In function 'void solve()':
foo.cc:13:34: error: expected ';' before 'int'
   13 |     for(int i = 0; i < m; i++) {b
      |                                  ^
      |                                  ;
   14 |         int x; cin >> x;
      |         ~~~                       
foo.cc:14:23: error: 'x' was not declared in this scope
   14 |         int x; cin >> x;
      |                       ^

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++) {b
        int x; cin >> x;
        if(x != 0)
            b.insert(x);
    }
    
    bool ans = (b.size() == 9 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:30:28
Judged At
2025-01-03 18:30:28
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes