题意 给定一个三角形和一个点 \(p\),如果该点不在三角形边上直接输出 \(-1\),否则在三角形上找一点 \(q\),使得线段 \(pq\) 平分三角形面积. 思路 看完题想都没想直接二分了. 就是比赛时复制粘贴的时候改错了,贡献了三发罚时. 板子来自 kuangbin 的模板. #include <bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-8; const db inf = 1e20;…
Alice's Print Service Time Limit: 2 Seconds      Memory Limit: 65536 KB Alice is providing print service, while the pricing doesn't seem to be reasonable, so people using her print service found some tricks to save money. For example, the price when…
Collision Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge There's a round medal fixed on an ideal smooth table, Fancy is trying to throw some coins and make them slip towards the medal to collide. There's also a round range which…
题目大意就是找出n的约数,然后把约数在m进制下展开,各个数位的每一位平方求和,然后按m进制输出. 模拟即可 #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<map> using namespace std; #define MOD 100000…
转载请注明出处,谢谢http://blog.csdn.net/ACM_cxlove?viewmode=contents    by---cxlove 题目:给出N个城市,从1开始需要遍历所有点,选择一些点建立加油站,使得花费最少 这题的特殊性在于他的花费上,2^(i-1) 利用一个非常重要的性质,2^0+2^1+2^2……+2^i<2^(i+1) 所有编号<=i的所有点都建,总花费比建一个还少. 这里就贪心一下,先假设所有点都建,然后依次从编号大的删点,看看能不能遍历整个图 dist[i]表示…
题目链接:http://codeforces.com/gym/101981/attachments n和m太小,空地联通无环,总步数太大,直接随机输出5w个方向 #include<iostream> #include<algorithm> #include<ctime> using namespace std; int t,a,b,c,d,k; int main() { srand((unsigned)time()); int n,m; ]={'L','R','U','…
题意:给出一个4×4的点阵,连接相邻点可以构成一个九宫格,每个小格边长为1.从没有边的点阵开始,两人轮流向点阵中加边,如果加入的边构成了新的边长为1的小正方形,则加边的人得分.构成几个得几分,最终完成九宫格时,谁的分高谁赢.现在给出两人前若干步的操作,问接下来两人都采取最优策略的情况下,谁赢. 分析:博弈搜索,有人说要加记忆化,我没有加也过了……与赤裸裸的博弈搜索的区别在于对于最终状态,并不是谁无路可走谁输,而是谁分低谁输.注意判断分数相等的情况.在搜索中每个节点要么是必胜态,要么是必败态,可参…
队名:Unlimited Code Works(无尽编码)  队员:Wu.Wang.Zhou 先说一下队伍:Wu是大三学长:Wang高中noip省一:我最渣,去年来大学开始学的a+b,参加今年区域赛之前只学了大部分图论内容,以及一些数据结构.动态规划等内容,水平不及两个队友... ... 首先流水账式的记录一下比赛过程吧,最后再写这一年的感想.体会与将来的学习计划. 先从长春站说起... ... 长春站是我加入ACM以来参加的第一场ICPC,因此无比的激动!从杭州出发,乘了整整24小时的火车,终…
2018ACM-ICPC南京现场赛D题-Country Meow Problem D. Country Meow Input file: standard input Output file: standard output In the 24th century, there is a country somewhere in the universe, namely Country Meow. Due to advanced technology, people can easily tra…
现场赛大佬打印的代码,观摩了一哈. 写了注释,贴一下,好好学习.%%%PKU 代码: //树上差分(LCA) #include<bits/stdc++.h> #define For(i,x,y) for (int i=x;i<y;i++) #define fi first #define se second #define pb push_back #define mp make_pair #define lf else if #define dprintf(...) fprintf(s…