poj 1552 Doubles
#include <stdio.h>
#include <stdlib.h>
];
int cmp(const void *a, const void *b)
{
return *(int*)a - *(int*)b;
}
int main()
{
int n,i,j,result;
)
{
i = result = ;
nums[i] = n;
++i;
while(scanf("%d",&n) && n)
{
nums[i] = n;
++i;
}
n = i;
qsort(nums,i,]),cmp);
; i < n; ++i)
{
; j < n; ++j)
{
&& nums[j]%nums[i] == )
{
++result;
break;
}
}
}
printf("%d\n",result);
}
}
poj 1552 Doubles的更多相关文章
- POJ.1552 Doubles(水)
POJ.1552 Doubles(水) 题意分析 暴力 代码总览 #include <cstdio> #include <stdio.h> #define nmax 100 u ...
- Poj 1552 Doubles(水题)
一.Description As part of an arithmetic competency program, your students will be given randomly gene ...
- POJ 1552 Doubles (C++ STL set使用)
题目: 题意:题意:给出几个正数(2~15个),然后就是求有这些数字的2倍有没有和原先的正数相同的,求出有几个,没有就是0. 分析:水题.用数组解决,开一个数组存正数,另开一个数组用来存这些数的2倍, ...
- POJ 1552
#include<iostream> using namespace std; int main() { ]; int i,j; ; do{ sum=; ;num[i-]!=&&a ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- POJ解题经验交流
感谢范意凯.陈申奥.庞可.杭业晟.王飞飏.周俊豪.沈逸轩等同学的收集整理. 题号:1003 Hangover求1/2+1/3+...1/n的和,问需多少项的和能超过给定的值 类似于Zerojudg ...
- 算法之路 level 01 problem set
2992.357000 1000 A+B Problem1214.840000 1002 487-32791070.603000 1004 Financial Management880.192000 ...
- Doubles 分类: POJ 2015-06-12 18:24 11人阅读 评论(0) 收藏
Doubles Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 19954 Accepted: 11536 Descrip ...
- poj 题目分类(1)
poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01 ...
随机推荐
- BZOJ 2754 喵星球上的点名(后缀数组)
题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=2754 题意:给出n个字典串,m个询问串.输出每个询问串出现在多少个字典串中.最后输出每个 ...
- ConnectionReset
ConnectionReset The connection was reset by the remote peer. http://stackoverflow.com/questions/1434 ...
- hibernate基础(1)
hibernate基础1.hibernate介绍与动手入门体验 问题:模型不匹配(java对象模型与数据库关系模型不匹配) 解决: 1.使用JDBC手工转换 2.使用ORM(Obje ...
- PopupWindwo和AlertDialog的区别
AlertDialog 是非阻塞式对话框:AlertDialog弹出时,后台还可以做事情:而PopupWindow是阻塞式对话框:PopupWindow弹出时, 程序会等 待,在PopupWind ...
- 浏览器兼容的css hack
<style> div{ background:green; /* for firefox */ *background:red; /* for IE6 */ } </style&g ...
- 结构体 lock_t;
typedef struct lock_struct lock_t; //利用typedef定义一个变量的类型 /** Lock struct */ struct lock_struct { trx_ ...
- 日期选择插件clndr的使用
需求是:在HTML中绘制日历直接供用户选择 而不是使用datepicker之类的表单插件让用户点击input后弹出datepicker让用户选择 浏览了一些解决方案后,发现 CLNDR 这个jQue ...
- R语言实战读书笔记(四)基本数据管理
4.2 创建新变量 几个运算符: ^或**:求幂 x%%y:求余 x%/%y:整数除 4.3 变量的重编码 with(): within():可以修改数据框 4.4 变量重命名 包reshape中有个 ...
- Debian 如何更改hdmi接口输出的分辨率
1. 先删除无用的文件: a) Boot/boot.src b) Boot/script.bin 2. 打开boot/script.fex,找到disp_init节点 a) 将screenX_outp ...
- codeforces 431 B Shower Line【暴力】
题意:给出五个人的编号,分别为 1 2 3 4 5,他们在排队, 最开始的时候,1和2可以交谈,3和4可以交谈 然后1走了之后,2和3交谈,4和5可以交谈 2走了之后,3和4可以交谈, 3走了之后,4 ...