제출 #1098144

#제출 시각아이디문제언어결과실행 시간메모리
1098144vjudge1은행 (IZhO14_bank)C++17
0 / 100
1045 ms344 KiB
#include <bits/stdc++.h> #define int long long #define pb push_back #define io ios_base::sync_with_stdio(0),cin.tie(0); #define str string using namespace std; const int maxn=1e6+2; int t, n , m, a[maxn],b[maxn],sum; signed main() { io; cin >> n>> m; for(int i = 1; i <= n ; i++){ cin >> a[i]; } for(int i = 1; i <= m ;i++){ cin >> b[i]; } for(int i = 1 ; i <= m ; i++){ int l = 1 , r = m ; while(l <= r){ int md = (l + r) / 2; if(b[md]== a[i]){ cout << "YES" ; return 0; }else if(b[md] < a[i]){ l = md - 1; }else{ r = md + 1; } } } cout << "NO"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...