HDU 5874 Friends and Enemies
Friends and Enemies
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 485 Accepted Submission(s): 271
For any two dwarves, if they are friends, at least one of the stones from each of their necklaces are of the same color; and if they are enemies, any two stones from each of their necklaces should be of different colors. Note that a necklace can be empty.
Now, given the population and the number of colors of stones on the island, you are going to judge if it's possible for each dwarf to prepare himself a necklace.
For each test case, the one and only line contains 2 positive integers M,N (M,N<231) representing the total number of dwarves (not including the king) and the number of colors of stones on the island.
#include <cstdio>
#define ll long long int main()
{
ll n, m;
while(~scanf("%I64d%I64d", &n, &m)){
printf((n/2)*(n-n/2) <= m ? "T\n" : "F\n");
}
return 0;
}
HDU 5874 Friends and Enemies的更多相关文章
- HDU 5874 Friends and Enemies 【构造】 (2016 ACM/ICPC Asia Regional Dalian Online)
Friends and Enemies Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Othe ...
- hdu 5874 Friends and Enemies icpc大连站网络赛 1007 数学
#include<stdio.h> #include<iostream> #include<algorithm> #include<math.h> #i ...
- hdu 5874
On an isolated island, lived some dwarves. A king (not a dwarf) ruled the island and the seas nearby ...
- hdu 5131 Song Jiang's rank list
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5131 Song Jiang's rank list Description <Shui Hu Z ...
- hdu 1155 Bungee Jumping
http://acm.hdu.edu.cn/showproblem.php?pid=1155 Bungee Jumping Time Limit: 2000/1000 MS (Java/Others) ...
- Hdu 3966-Aragorn's Story LCT,动态树
题目:http://acm.hdu.edu.cn/showproblem.php?pid=3966 Aragorn's Story Time Limit: 10000/3000 MS (Java/Ot ...
- HDU 5889 Barricade 【BFS+最小割 网络流】(2016 ACM/ICPC Asia Regional Qingdao Online)
Barricade Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total S ...
- HDU 5876 Sparse Graph 【补图最短路 BFS】(2016 ACM/ICPC Asia Regional Dalian Online)
Sparse Graph Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)To ...
- hdu 4970 Killing Monsters(数学题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4970 Problem Description Kingdom Rush is a popular TD ...
随机推荐
- 02 - Tomcat配置
Tomcat配置 本文内容 介绍 Windows UNIX daemon 1.介绍 首选看Tomcat目录下的RUNNING.TXT 2.Windows平台下 可以选择下载windows instal ...
- HTML5 文件API(一)
1.FileList对象与File对象 2.文件API之Bolb对象 A Blob object represents a file-like object of immutable, raw dat ...
- Git教程之版本回退(4)
现在,我们已经学会了修改文件,然后把修改提交到Git版本库,现在再次修改readme.txt文件如下:
- Java API —— Date类
1.Date类概述 类 Date 表示特定的瞬间,精确到毫秒. 2.构造方法 public Date():分配 Date 对象并初始化此对象,以表示分配它的时间(精确到毫秒). public Dat ...
- twitter bootstrap 2.x 3.x区别
栅格系统 (Grid system)说个我认为比较重要的,相对于RC 1中的3层,现在有4层了 We now have .col-xs (phones), .col-sm (tablets), .co ...
- Vim的tagbar插件
1.tagbar针对当前文件,调用ctags来生成结果,并抓取其结果,像下边这样的 ctags -f - --format=2 --excmd=pattern --extra= --fields=nk ...
- sdut 2847 Monitor (思维题)
题目 题意:给定a, b, x, y; 求使c, d; 使c:d = x :y; 且c<=a, d<=b, 而且c, d尽量大. 先求最小倍数, 再用最小倍数乘 x, y; #inclu ...
- hdu 1575 Tr A (矩阵快速幂入门题)
题目 先上一个链接:十个利用矩阵乘法解决的经典题目 这个题目和第二个类似 由于矩阵乘法具有结合律,因此A^4 = A * A * A * A = (A*A) * (A*A) = A^2 * A^2.我 ...
- fzu Problem 2148 Moon Game(几何 凸四多边形 叉积)
题目:http://acm.fzu.edu.cn/problem.php?pid=2148 题意:给出n个点,判断可以组成多少个凸四边形. 思路: 因为n很小,所以直接暴力,判断是否为凸四边形的方法是 ...
- UVa 10003 (可用四边形不等式优化) Cutting Sticks
题意: 有一个长为L的木棍,木棍中间有n个切点.每次切割的费用为当前木棍的长度.求切割木棍的最小费用. 分析: d(i, j)表示切割第i个切点到第j个切点这段所需的最小费用.则有d(i, j) = ...