poj 1552 Doubles
2011-07-18 11:23
323 查看
#include <iostream> #include <algorithm> using namespace std; int top,list[16]; bool db(int i) { int j; for( j=i+1;j<top;j++) if(list[j]>=2*list[i]) break; if(list[j]==2*list[i]) return true; return false; } int main() { int a,s,i; while(cin>>a&&a!=-1) { list[0]=a;top=1; while(cin>>a&&a) list[top++]=a; sort(list,list+top); s=0; for(i=0;i<top-1;i++) if(db(i)) s++; cout<<s<<endl; } return 0; }
相关文章推荐
- (DS1.4.)poj 1552 Doubles(测试组数和每组测试用例的个数不定)
- poj 1552 Doubles(简单的模拟一下)
- ZOJ 1760 &&POJ1552 Doubles (模拟)
- POJ 1552 Doubles
- POJ 1552 Doubles
- poj 1552 Doubles
- poj 1552 Doubles【goto语句】
- POJ-1552 Doubles-二倍关系
- POJ 1552 Doubles
- POJ 1552-Doubles
- poj1552--Doubles
- poj 1552 Doubles 水
- POJ 1552 - Doubles
- poj 1552 Doubles
- [1552]Doubles (纯水题) POJ
- POJ 1552 Doubles
- poj 1552 Doubles
- poj 1552 Doubles
- POJ 1552 && HDU 1303 Doubles(水~)
- POJ 1552 Doubles 水