On an isolated island, lived some dwarves. A king (not a dwarf) ruled the island and the seas nearby, there are abundant cobblestones of varying colors on the island. Every two dwarves on the island are either friends or enemies. One day, the king demanded that each dwarf on the island (not including the king himself, of course) wear a stone necklace according to the following rules:
  
  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.InputMultiple test cases, process till end of the input.
  
  For each test case, the one and only line contains 2 positive integers M,N (M,N<231)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.OutputFor each test case, The one and only line of output should contain a character indicating if it is possible to finish the king's assignment. Output ``T" (without quotes) if possible, ``F" (without quotes) otherwise.Sample Input

20 100

Sample Output

T

很简单的一道题,当所有人构成二分图的时候,需要的颜色最多。
附ac代码:
 1 #include <cstdio>
2 #include <iostream>
3 #include <cmath>
4 #include <cstring>
5 #include <algorithm>
6 #define ll long long
7 const int maxn = 1000+10;
8 using namespace std;
9
10 int main() {
11
12 ll n,m;
13 while(~scanf("%lld %lld",&n,&m))
14 {
15 if(((n+1)/2)*(n/2)<=m)
16 printf("T\n");
17 else
18 printf("F\n");
19 }
20
21 return 0;
22 }

最新文章

  1. qt 单文档程序关闭时在delete ui处出现segmentation fault
  2. vc++创建文件目录
  3. Python新手学习基础之初识python——与众不同1
  4. 使用jquery处理ajax返回XML
  5. 哞哞快的 C# 高斯模糊实现(续)
  6. Android Studio2.1 Run APP:Error: Execution failed for task
  7. 《TCP-IP详解卷3:TCP 事务协议、HTTP、NNTP和UNIX域协议》【PDF】下载
  8. EditTable-V1.0--续集
  9. break用法
  10. 封装ajax原理
  11. BZOJ4551[Tjoi2016&amp;Heoi2016]树——dfs序+线段树/树链剖分+线段树
  12. for循环输出9~0
  13. log4j 文件配置
  14. .NetCore 发布到 Centos docker
  15. 使用GIT SUBTREE集成项目到子目录(转)
  16. Office - Outlook
  17. 2019年所有人必须要掌握的一个技能 - “AI思维”
  18. Codeforces Round #385 (Div. 2)A B C 模拟 水 并查集
  19. IP地址及子网--四种IP广播地址
  20. Android 蓝牙学习

热门文章

  1. 【Android初级】使用TypeFace设置TextView的文字字体(附源码)
  2. 使用remix实现给合约账户转账
  3. 调度 GMP
  4. (Oracle)导出表结构
  5. luoguP6754 [BalticOI 2013 Day1] Palindrome-Free Numbers
  6. loj10006数列分段
  7. codevs1700 施工方案第二季
  8. MVC架构 项目实践
  9. Linux常用命令详解(第三章)(ping、kill、seq、du、df、free、date、tar)
  10. DEDECMS:解决BMP、jpeg图片或MP4视频无法上传和在后台无法显示