摘要: One of the programming paradigm in parallel processing is the producer/consumer paradigm that can be implemented using a system with a "manager" proce 阅读全文
posted @ 2018-08-03 22:47 小小的嘤嘤怪 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Pascal University, one of the oldest in the country, needs to renovate its Library Building, because after all these centuries the building started to 阅读全文
posted @ 2018-08-02 11:27 小小的嘤嘤怪 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Given the input 22, the following sequence of numbers will be printed 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 It is conjectured that the algorithm 阅读全文
posted @ 2018-08-01 14:26 小小的嘤嘤怪 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 这道题可以使用数学公式计算出来。一共工作了n天,则n=1+2+3+4+...+a+b,0<=b<a+1,如n=16,则a=5,b=1。设0.5*(a02+a0)=n,由函数y=0.5*(x2+x)的函数图像可知,0<=a0-a<1。a0向下取整,得到a。然后这道题国王需要支付的金币就可以分两部分计算 阅读全文
posted @ 2018-08-01 10:42 小小的嘤嘤怪 阅读(134) 评论(0) 推荐(0) 编辑
摘要: In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus 阅读全文
posted @ 2018-07-31 15:53 小小的嘤嘤怪 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 这道题不怎么难,在每计算一次路程后,需要将这次输入的时间保存起来,下一次计算的时候,输入的时间需要减去上次保存的时间。 1 #include<stdio.h> 2 3 int main(void) 4 { 5 int i;//用于循环 6 int n; 7 int s,t,sum;//速度,时间,总 阅读全文
posted @ 2018-07-30 22:31 小小的嘤嘤怪 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 不知道为什么在POJ上就是通不过编译。。。 因为数据范围并不大,所以可以离线计算出所有的丑数。 说实话这个算法是网上找的,但是没有怎么看懂。 1 #include<stdio.h> 2 #include<string.h> 3 4 5 int a[1510];//丑数数组 6 7 int min(i 阅读全文
posted @ 2018-07-30 11:40 小小的嘤嘤怪 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Write a program to read four lines of upper case (i.e., all CAPITAL LETTERS) text input (no more than 72 characters per line) from the input file and 阅读全文
posted @ 2018-07-30 11:07 小小的嘤嘤怪 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 使用的是高中数学的一个公式,p=(a+b+c)/2,s=sqrt(p*(p-a)*(p-b)*(p-c)),由正弦定理a/sinA=b/sinB=c/sinC=2r,s=0.5*a*b*sinC,所以r=a*b*c/(4*s),然后就可以求周长了。 1 #include <stdio.h> 2 #i 阅读全文
posted @ 2018-07-30 10:50 小小的嘤嘤怪 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Problem A: Good evening, contestants. If a and d are relatively prime positive integers, the arithmetic sequence beginning with a and increasing by d, 阅读全文
posted @ 2018-07-30 10:45 小小的嘤嘤怪 阅读(113) 评论(0) 推荐(0) 编辑
TOP