当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3024:The Gossiping System

题目描述
A common amusement in almost any society, though certainly not the most glamorous one, is for its inhabitants to spread rumours about each other. In the town of Knoxville, this is definitely known to be the case. In order to establish some sort of order without completely ruin the pleasure of gossiping, they have agreed on a system for everyday life activities, in which rumours spread in a controlled fashion. The inhabitants meet in certain groups in their work, as well as in their spare time, on a daily basis. The following three criteria are met for their system:
  • Each group must have the same non-zero number of members m.
  • Each person must belong to the same number of groups r, as any other person.
  • Each pair of different groups has exactly one member in common.
We say that a (n,g,m,r)-gossiping system is such a system consisting of n persons divided into g groups, with m and r as above. The beauty of these systems lies in their uniformity. The construction seems fair to everyone, and still all meetings are held in small groups. Since any two groups have a member in common, information about the activities and people in one group is swiftly transferred to all the other groups. Furthermore, it is easy for a messenger to lie if he or she would like to, since the truth is hard to validate due to the fact that no two persons share more than one group. Unfortunately, there are several combinations of n, g, and m for which these systems do not exist!

As a mathematician living in Knoxville, you are interested in studying the existence conditions for these systems for large values of n. However, you soon realise the complexity of these combinatorial objects, and choose to study only their simplest non-trivial class, the (n,g,m,2)-gossiping systems.
输入解释
On the first line of input, is a single positive integer t. Thereafter t test cases follow. Each test case consists of one positive number n, 1 <= n <= 1050, given in the standard base 10 representation, where n specifies the number of persons.
输出解释
For each test case in the input, output the text 'Yes.' on a line of its own, if there exists a (n,g,m,2)-gossiping system for any positive integers g>1 and m>0 for the value of n in the test case, otherwise output the text 'No.'
输入样例
5
3
4
5
6
678678658335615
输出样例
Yes.
No.
No.
Yes.
Yes.

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3024

最后修改于 2020-10-29T06:50:27+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536