码迷,mamicode.com
首页 >  
搜索关键字:nyoj 678 最小k个数之和    ( 1822个结果
NYOJ 1082 买新书了【简单题】
题目链接   #include int main() { int T,N,K; scanf("%d",&T); while(T--) { scanf("%d%d",&N,&K); if(N%K==0) printf("%d\n",N/K); else printf("%d\n",N/K+1); } return 0; }...
分类:其他好文   时间:2015-02-16 22:14:31    阅读次数:162
NYOJ 78 圈水池( 凸包入门)
链接:click here 题目:有一个牧场,牧场上有很多个供水装置,现在牧场的主人想要用篱笆把这些供水装置圈起来,以防止不是自己的牲畜来喝水,各个水池都标有各自的坐标,现在要你写一个程序利用最短的篱笆将这些供水装置圈起来!(篱笆足够多,并且长度可变) 输出各个篱笆经过各个供水装置的坐标点,并且按照x轴坐标值从小到大输出,如果x轴坐标值相同,再安照y轴坐标值从小到大输出 样例输入...
分类:其他好文   时间:2015-02-16 22:11:37    阅读次数:228
NYOJ 1165 just a problem【计算几何】
题目链接 #include #include struct point { double x; double y; }circle,a,b,c,d; double r; double dis(point &a,point &b) { return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)); } in...
分类:其他好文   时间:2015-02-16 18:25:25    阅读次数:152
NYOJ 66 分数拆分【数学题】
题目链接 #include int main() { int i,s,k,x; scanf("%d",&s); while(s--) { scanf("%d",&k); for(i=k+1;i<=2*k;i++) { x=(k*i)/(i-k); if(k == i*x/(x+i)) printf("1/%d=1/%d+1/%d\n",k...
分类:其他好文   时间:2015-02-16 10:19:24    阅读次数:150
NYOJ 1156 素数三元组【尝试题】
题目链接 #include int main() { int n; while(~scanf("%d",&n)) { if(n>=7) printf("3 5 7\n"); else printf("No triple\n"); } return 0; }...
分类:其他好文   时间:2015-02-16 10:18:28    阅读次数:172
最大值子区间和的一维二维问题
一维问题:nyoj 44 子串和 链接:click here 题目大意:给定一整型数列{a1,a2...,an},找出连续非空子串{ax,ax+1,...,ay},使得该子序列的和最大,其中,1 思路:m是元素总个数,sum是第一个元素,将当前的第一个元素作为最大值max,之后依次输入,检查sum 代码: #include #include #include #includ...
分类:其他好文   时间:2015-02-15 23:12:25    阅读次数:185
NYOJ 615 最近点对【简单题】
题目链接   #include #include using namespace std; int a[1100]; int main() { int i,n,min,temp; while(~scanf("%d",&n)) { min=10000000; for(i=0;i<n;i++) scanf("%d",&a[i]); sort(...
分类:其他好文   时间:2015-02-15 18:11:19    阅读次数:135
NYOJ 280 LK的项链 &&POJ 2409 Let it Bead(polya 定理)
NYOJ 280 LK的项链  :click here POJ 2409 Let it Bead:click here 题意:一盒有红、蓝、绿三种颜色的珠子,每种颜色珠子的个数都大于24,现在LK想用这一盒珠子穿出一条项链,项链上的珠子个数为n(0           poj 上是c种颜色,s个珠子组成,数据比24小。 思路:今天刚接触到polya 定理: Polya定理:设...
分类:其他好文   时间:2015-02-15 10:45:22    阅读次数:172
NYOJ 590 相同的和【数学题】
http://acm.nyist.net/JudgeOnline/problem.php?pid=590 #include int a[1010]; int main() { int n,m,i,j,sum,temp; while(~scanf("%d%d",&n,&m)) { sum=0; for(i=0;i<n;i++) scanf("%d",&a[i]); ...
分类:其他好文   时间:2015-02-15 09:29:19    阅读次数:192
NYOJ-120 校园网络 &&POJ 1236 (强连通缩点targan算法)
链接:click here 题意: 校园网络 时间限制:3000 ms  |  内存限制:65535 KB 难度:5   描述 南阳理工学院共有M个系,分别编号1~M,其中各个系之间达成有一定的协议,如果某系有新软件可用时,该系将允许一些其它的系复制并使用该软件。但该允许关系是单向的,即:A系允许B系使用A的软件时,B未必一定允许A使用B的软件。 现在,请你写一个程序,根据...
分类:编程语言   时间:2015-02-13 14:51:34    阅读次数:211
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!