随笔分类 -  模拟

摘要:First year of new millenium is gone away. In commemoration of it write a program that finds the name of the day of the week for any date in 2001. Inpu 阅读全文
posted @ 2017-08-09 14:44 西北会法语 阅读(201) 评论(0) 推荐(0)
摘要:Computer simulations often require random numbers. One way to generate pseudo-random numbers is via a function of the form seed(x+1) = [seed(x) + STEP 阅读全文
posted @ 2017-08-09 14:41 西北会法语 阅读(222) 评论(0) 推荐(0)
摘要:Consider equations having the following form: a*x1^2+b*x2^2+c*x3^2+d*x4^2=0 a, b, c, d are integers from the interval [-50,50] and any of them cannot 阅读全文
posted @ 2017-08-08 18:27 西北会法语 阅读(148) 评论(0) 推荐(0)
摘要:Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. However, he finds the game 阅读全文
posted @ 2017-08-02 19:50 西北会法语 阅读(144) 评论(0) 推荐(0)
摘要:假设: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 = 1234567891 S11 = 12345678912 ............ S18 = 123456789123456789 .............. 阅读全文
posted @ 2017-08-02 19:48 西北会法语 阅读(131) 评论(0) 推荐(0)
摘要:追逐影子的人,自己就是影子。 ——荷马 Allison 最近迷上了文学。她喜欢在一个慵懒的午后,细细地品上一杯卡布奇诺,静静地阅读她爱不释手的《荷马史诗》。但是由《奥德赛》和《伊利亚特》组成的鸿篇巨制《荷马史诗》实在是太长了,Allison 想通过一种编码方式使得它变得短一些。 一部《荷马史诗》中有 阅读全文
posted @ 2017-08-01 16:52 西北会法语 阅读(230) 评论(0) 推荐(0)
摘要:Let S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways: q By an integer sequence P = p1 p2...pn where pi i 阅读全文
posted @ 2017-08-01 16:51 西北会法语 阅读(100) 评论(0) 推荐(0)
摘要:Alice and Bob play 5-in-a-row game. They have a playing field of size 10 × 10. In turns they put either crosses or noughts, one at a time. Alice puts 阅读全文
posted @ 2017-08-01 16:50 西北会法语 阅读(152) 评论(0) 推荐(0)
摘要:Array of integers is unimodal, if: it is strictly increasing in the beginning; after that it is constant; after that it is strictly decreasing. The fi 阅读全文
posted @ 2017-08-01 16:48 西北会法语 阅读(209) 评论(0) 推荐(0)