Advertisement
vitormartinotti

proibido

Jun 24th, 2024
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. set<int> s;
  5.  
  6. int main() {
  7.  
  8.    int n; scanf("%d", &n);
  9.  
  10.    while(n--){
  11.       int num;
  12.       scanf("%d", &num);
  13.       s.insert(num);
  14.    }
  15.  
  16.    int p;
  17.    while(scanf("%d", &p) != EOF) {
  18.       if(s.find(p) == s.end()){
  19.          printf("nao\n");
  20.       }
  21.       else{
  22.          printf("sim\n");
  23.       }
  24.    }
  25.  
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement