1249 Problem Q】的更多相关文章

问题 Q: 比大小 时间限制: 1 Sec  内存限制: 128 MB 提交: 159  解决: 66 [提交][状态][讨论版] 题目描述 给你两个很大的数,你能不能判断出他们两个数的大小呢? 比如123456789123456789要大于-123456 输入 每组测试数据占一行,输入两个不超过1000位的10进制整数a,b 数据保证输入的a,b没有前缀的0. 如果输入0 0表示输入结束.测试数据组数不超过10组 输出 如果a>b则输出“a>b”,如果a<b则输出“a<b”,如果…
Problem Q: C语言习题 计算该日在本年中是第几天 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 4572  Solved: 2474[Submit][Status][Web Board] Description 定义一个结构体变量(包括年.月.日).编写一个函数days,由主函数将年.月.日传递给函数days,计算出该日在本年中是第几天并将结果传回主函数输出. Input 年月日 Output 当年第几天 Sample Input 200…
Problem Description A factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers in the square parcels of the same height h as the products h…
#include<stdio.h> #include<math.h> int main() { float x,i; scanf("%f",&x); double tmp=x,y=x; i=; while(tmp>=0.00001) { tmp=pow(x,i); ;k<=i;k++) tmp=tmp/k; y+=tmp; i++; } printf("%.3f",y); ; }…
#include<stdio.h> int main() { int a1,b1,c1,a2,b2,c2,s; scanf("%d-%d-%d",&a1,&b1,&c1); scanf("%d-%d-%d",&a2,&b2,&c2); s=c2-c1-; printf("%d",s); ; }…
0x01 从判定问题到形式语言 这篇讲知识证明的wiki([1]): https://en.wikipedia.org/wiki/Proof_of_knowledge 里面有一句话: Let x be a language element of language L in NP 这篇讲NPC的文章([2]) http://www.cs.princeton.edu/courses/archive/spr11/cos423/Lectures/NP-completeness.pdf 里面提到Decis…
题目链接:https://vjudge.net/contest/68966#problem/Q 分析:这里的对称并不是指的是关于原矩阵(也就是最大的那一个)主对角线对称,而是对于每一个小的矩阵来说,当前矩阵的对反对角线. #include<iostream> #include<string> #include<cmath> #include<cstring> #include<algorithm> #include<stdio.h>…
题目链接http://codeforces.com/contest/1249/problem/B2 .并查集思想,将数分成多个集合,每个集合的大小就是一轮的所需天数. Map[i]存储数据. flag[i]来表示第i个数是否被访问过. mm[i]记录第i个集合所对应的集合大小,索引i为第i个集合的根对应的值. getParent方法利用递归的思想更新每个节点的上继,直接指向当前集合的根. 由于访问过的集合不再进行访问,因此,分析时间复杂度,准确是O(CN),C为一个常数.在这里需要注意的是,mm…
题目链接http://codeforces.com/contest/1249/problem/C2.这是道进制转换题,我们的目的是找到最小的一个每个位都是1的三进制数来表示一个十进制数n.做法是,先将n转换为一个三进制数,然后对当前位加上低位的进位大于等于2的位置0并进位,这一步需要注意的是,当前位如果产生进位,需要把该位的低位都给置0,这样才能保证重构后的数最小. 此外,需要注意的是,在利用重构数组计算10进制数的时候,不能用pow函数,因为,pow对3的38次幂是无法计算的,会发生溢出,需要…
Current Time: 2016-03-11 17:45:36 Contest Type: Public Start Time: 2016-03-04 13:00:00 Contest Status: Running End Time: 2016-05-03 13:00:00 Manager: qwerqqq Clone this contest Edit Delete     ID Origin Title 1 / 1 Problem A HDU 1045 Fire Net 1 / 1 P…