mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
25 lines
507 B
C++
25 lines
507 B
C++
#include<iostream>
|
|
#include<vector>
|
|
#include<algorithm>
|
|
using namespace std;
|
|
int main()
|
|
{
|
|
int temp;
|
|
while(cin>>temp&&temp!=-1)
|
|
{
|
|
vector<int> v;
|
|
v.push_back(temp);
|
|
while(cin>>temp&&temp!=0)
|
|
v.push_back(temp);
|
|
int sum=0;
|
|
for(int i=0;i!=v.size();++i)
|
|
{
|
|
auto b=find(v.cbegin(),v.cend(),2*v[i]);
|
|
if(b!=v.cend())
|
|
sum++;
|
|
}
|
|
cout<<sum<<endl;
|
|
}
|
|
return 0;
|
|
}
|