团 大连网赛 1007 Friends and Enemies

 1 //大连网赛 1007 Friends and Enemies
 2 // 思路:思路很棒!
 3 // 转化成最大二分图
 4 // 团:点集的子集是个完全图
 5 // 那么朋友圈可以考虑成一个团,原题就转化成用团去覆盖怎样最多。团至少是2个点,所以就是n*n/4
 6
 7 #include <bits/stdc++.h>
 8 using namespace std;
 9 #define LL long long
10 typedef pair<int,int> pii;
11 const double inf = 123456789012345.0;
12 const LL MOD =100000000LL;
13 const int N =1e4+10;
14 #define clc(a,b) memset(a,b,sizeof(a))
15 const double eps = 1e-7;
16 void fre() {freopen("in.txt","r",stdin);}
17 void freout() {freopen("out.txt","w",stdout);}
18 inline int read() {int x=0,f=1;char ch=getchar();while(ch>‘9‘||ch<‘0‘) {if(ch==‘-‘) f=-1; ch=getchar();}while(ch>=‘0‘&&ch<=‘9‘) {x=x*10+ch-‘0‘;ch=getchar();}return x*f;}
19
20 int main(){
21     int n,m;
22     while(~scanf("%d%d",&n,&m)){
23        if(m>=(LL)n*n/4) puts("T");
24        else puts("F");
25     }
26     return 0;
27 }
时间: 2024-10-25 21:25:51

团 大连网赛 1007 Friends and Enemies的相关文章

2016 大连网赛

总结:弱爆了,一题都没做出 1006   Football Games    HDU 5873 1.题意:团队比赛,赢的+2,输的+0,平+1.给出最后分数,看是否符合. 2.总结:好像是有个定理判定这种序列, s?1??+s?2??+...+s?i??≥i(i−1),对于所有1≤i≤n−1s?1??+s?2??+...+s?n??=n(n−1),对于i==n #include<iostream> #include<cstring> #include<cmath> #i

2016 大连网赛---Weak Pair(dfs+树状数组)

题目链接 http://acm.split.hdu.edu.cn/showproblem.php?pid=5877 Problem Description You are given a rooted tree of N nodes, labeled from 1 to N. To the ith node a non-negative value ai is assigned.An ordered pair of nodes (u,v) is said to be weak if  (1) u

2016大连网赛

网赛的时候就是前三个小时过了后面五道,然后两个小时就没搞出啥了;账号密码都忘了,只好重新写一遍了; hdu-5868 hdu-5869 hdu-5870 hdu-5871 hdu-5872 hdu-5873 hdu-5874 hdu-5875 hdu-5876 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath>

ACM学习历程—HDU 5451 Best Solver(Fibonacci数列 &amp;&amp; 快速幂)(2015长春网赛1007题)

Problem Description The so-called best problem solver can easily solve this problem, with his/her childhood sweetheart. It is known that y=(5+2√6)^(1+2^x).For a given integer x (0≤x<2^32) and a given prime number M (M≤46337) , print [y]%M . ([y] mean

蒲京博士为第七届环海南岛国际大帆船赛创造历史

蒲京博士为总设计师之中国法诺打造的陵水号,海口号.三亚号包揽第七届环海南岛国际大帆船赛冠.亚.季军,实现大满贯!创造历史 近日,蒲京博士为总设计师之中国法诺打造的陵水号,海口号.三亚号包揽第七届环海南岛国际大帆船赛冠.亚.季军,实现大满贯!创造历史 蒲京表示:在过去的十个月里,中国团队一直致力于打造第二个专属船队品牌中国一号(CHINA ONE).而加盟系列赛也是中国一号船队成立后首次正式亮相国际赛场.船队首席执行官克雷格·蒙克将参加国际极限帆船系列赛视为实现团队理想的重要途径:"系列赛是我们踏

第三届沈阳航空航天大学校赛(大连海事大学赛)---I: Spoors (预处理)

Spoors Time Limit: 1 Sec  Memory Limit: 128 MB Description Some of you may know when a snail crawls; he will leave a spoor after his tour. Then all of you will know that when many snail crawls, they will leave many spoors. In this problem, you will b

ACM学习历程—HDU 5443 The Water Problem(RMQ)(2015长春网赛1007题)

Problem Description In Land waterless, water is a very limited resource. People always fight for the biggest source of water. Given a sequence of water sources with a1,a2,a3,...,an representing the size of the water source. Given a set of queries eac

(周日赛)Friends or Enemies?

题意:判断两点是否在线段的同一方,点不能在线上. 题解:模拟一下 DescriptionA determined army on a certain border decided to enumerate the coordinates in its patrol in a way to make it difficult for the enemy to know what positions they are referring to in the case that the radio s

hdu5443(2015长春赛区网络赛1007)暴力

题意:给了一个数列,有多个询问,每个询问求某个区间内的最大值 数列长度 1000,询问个数 1000,静态,并不需要RMQ这些,直接暴力 n2 查找每个询问区间取最大值就行了. 1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 #include<math.h> 5 using namespace std; 6 typedef long long ll; 7 const int m