简答题 适中
#24804

找数

找数

未登录也能判分,登录后才会记录
答案与解析
正确答案:<pre class="brush:cpp;toolbar:false;">#include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;algorithm&gt; using namespace std; int main() {     int n, m;     cin &gt;&gt; n &gt;&gt; m;     vector&lt;int&gt; a(n);     for(int i = 0; i &lt; n; i++)         cin &gt;&gt; a[i];     sort(a.begin(), a.end());     int ans = 0;     int b;     for(int i = 0; i &lt; m; i++){         cin &gt;&gt; b;         if(binary_search(a.begin(), a.end(), b)){             ans++;         }     }     cout &lt;&lt; ans;     return 0; }</pre>
这道题暂未补解析。