其他
Cifer
这个作者很懒,什么都没留下…
展开
-
HDOJ 2089 不要62
题目链接:。。。。。。。。。 code: #include int num[1000000];//记录1~j的要排除数的个数 int main() { int i = 0, n = 0, m = 0, flag = 0, cur = 0, sum = 0; for(i = 1; i<1000000; i++) { cur = i;原创 2012-07-12 18:00:37 · 522 阅读 · 0 评论 -
HDOJ 1873 看病要排队 (结构体快排)
题目链接:( ¯ □ ¯ ) 思路:用结构体排序, 按优先权从小到大, 如果优先权一样按ID号从大到小排 code: #include #include typedef struct { int level, num; }node; node quene[4][4004]; int count1 = 0, count2 = 0, count3 = 0; int c原创 2012-04-24 14:58:38 · 847 阅读 · 0 评论 -
POJ 3253 Fence Repair (堆排序)
题目连接:~( ̄▽ ̄~)(~ ̄▽ ̄)~ 用堆排序建立小根堆每回选取2个最小的值相加,再把得到的值放回堆中排序 code: #include int num[20009], n = 0; __int64 sum = 0, sum2 = 0; void sift(int l); void heapsort(); int main() { int i = 0; while原创 2012-04-17 16:18:13 · 657 阅读 · 0 评论 -
HDOJ 1040 As Easy As A+B 快排
Problem Description These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights. Give原创 2012-03-29 20:41:48 · 843 阅读 · 0 评论 -
HDOJ 1042 N! (大数)
Problem Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! Input One N in one line, process to the end of file. Output For each N, output N! in one line. Sample In原创 2012-04-02 12:39:41 · 479 阅读 · 0 评论