|
|
вернуться в форум8 Time limit Послано daria 10 май 2013 02:07 Please, help me #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int M, N, t=0, d; cin>>N; vector<int> n(N); for(int i=0; i<N; i++) { cin>>n[i]; } sort(n.begin(), n.end()); n.erase(unique(n.begin(), n.end() ), n.end()); cin>>M; for(int i=0; i<M; i++) { cin>>d; if((d>=n[0])and(d<=n[N-1])) { t+=count(n.begin(),n.end(),d); } } cout<<t; return(0); } Re: 8 Time limit Послано fotol 12 май 2013 02:28 var n,k,m,i,i1:longint; w:array[1..1000000] of longint; w1:array[1..100000] of longint; begin readln(n); For i:=1 to n do readln(w[i]); readln(m); For i:=1 to m do readln(w1[i]); For i:=1 to n do begin For i1:=1 to m do begin if w[i]=w1[i1] Then begin k:=k+1; w1[i1]:=0; end; end; end; Writeln(k); end. I have the WA too. HELLLP |
|
|