Irrational problem
来源:互联网 发布:mysql查找替换字符串 编辑:程序博客网 时间:2024/04/30 15:26
第一次做CF,第一次用STL,纪念一下!
Codeforces Beta Round #62
A. Irrational problem
Little Petya was given this problem for homework: You are given function (here represents the operation of taking the remainder). His task is to count the number of integers x in range [a;b] with property f(x) = x. It is a pity that Petya forgot the order in which the remainders should be taken and wrote down only 4 numbers. Each of 24 possible orders of taking the remainder has equal probability of being chosen. For example, if Petya has numbers 1, 2, 3, 4 then he can take remainders in that order or first take remainder modulo 4, then modulo 2, 3, 1. There also are 22 other permutations of these numbers that represent orders in which remainder can be taken. In this problem 4 numbers wrote down by Petya will be pairwise distinct. Now it is impossible for Petya to complete the task given by teacher but just for fun he decided to find the number of integers with property that probability that f(x) = x is not less than 31.4159265352718281828459045%. In other words, Petya will pick up the number x if there exist at least 7 permutations of numbers p1, p2, p3, p4, for which f(x) = x. First line of the input will contain 6 integers, separated by spaces: p1, p2, p3, p4, a, b (1 ≤ p1, p2, p3, p4 ≤ 1000, 0 ≤ a ≤ b ≤ 31415). It is guaranteed that numbers p1, p2, p3, p4 will be pairwise distinct. Output the number of integers in the given range that have the given property.2 7 1 8 2 8
0
20 30 40 50 0 100
20
31 41 59 26 17 43
9
比着刘汝佳白皮书上的下一个排列写的,继续努力吧!
- Irrational problem
- A. Irrational problem
- 【水模拟】#62 A. Irrational problem
- CodeForces 68 A.Irrational problem(水~)
- gym100818F-F - Irrational Roots
- Gym 100818 F Irrational Roots (数学)
- Sensible, not sensitive; simply complicated; predictably irrational; kindly demanding; constructivel
- [数学 FFT] Codechef July Challenge 2017 #APRPS Irrational Root
- problem
- Problem
- problem
- Problem
- Problem
- Problem
- Problem
- Problem
- Problem
- problem
- 先写个symbian的吧 symbian中的.pkg文件详解
- 需要写一写了
- 以前代码无法运行的一系列问题
- Struts2的模型驱动、属性驱动的理解
- 进步DSP代码运行性能的研究
- Irrational problem
- 一分钟先生: 程序员面试真经
- 设计模式-代理模式(Proxy Pattern)
- 4-Bit Computer
- Virtualbox虚拟CentOS5.1 :安装virtualbox增强工具,提示无权限
- Oracle10g中启动和关闭OEM
- 做生意的十大禁忌
- 利用Python抓取和解析网页(二)
- linux:挂载光盘