A: Anton and Polyhedrons(水题) B: Anton and Classes(水题) C: Anton and Fairy Tale(二分) 思路:m>=n时 ans=n;m<n时 前m天都能补满,第m+1天时就要开始减少了,n-m-(x+1)*x/2是m天后第x天的剩余,二分 ...
分类:
其他好文 时间:
2017-03-16 20:27:39
阅读次数:
163
A. Anton and Polyhedrons 直接统计+答案就可以了。 #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #define maxn 1000 #define LL long long us ...
分类:
其他好文 时间:
2017-03-16 19:01:58
阅读次数:
225
位运算。 两个数的和:$A+B=(AandB)+(AorB)$,那么$b[i]+c[i]=n*a[i]+suma$。可以解出一组解,然后再按位统计贡献验证一下。 ...
分类:
其他好文 时间:
2017-02-12 17:39:31
阅读次数:
164
$dfs$缩点,树形$dp$。 首先将连通块缩点,缩点后形成一个黑白节点相间的树。接下来的任务就是寻找一个$root$,使这棵树以$root$为根,树的高度是最小的(也就是一层一层染色)。树形$dp$可以解决这个问题,第一次$dfs$处理子树,第二次$dfs$枚举$root$计算答案。 ...
分类:
其他好文 时间:
2017-02-12 14:36:51
阅读次数:
188
A.Anton and Danik Problems: 给你长度为N的,只含‘A’,'D'的序列,统计并输出何者出现的较多,相同为"Friendship" Analysis: lucky_ji: 水题,模拟统计A和D的数目比较大小输出结果即可 Tags: Implementation B.Anton ...
分类:
其他好文 时间:
2016-11-19 03:23:28
阅读次数:
262
Anton and Making Potions 安东和他的药水 安东做一份药水有2种方法: 1.把做药水的时间X换成Ai,花费Bi 魔法 2.一瞬间做成Ci份药水,花费Di 魔法 问,最少需要多少时间 二分魔法值 n,m,k = list(map(int,input().split())) x,s ...
分类:
其他好文 时间:
2016-11-17 20:27:43
阅读次数:
231
A. Anton and Danik Anton likes to play chess, and so does his friend Danik. Once they have played n games in a row. For each game it's known who was t ...
分类:
其他好文 时间:
2016-11-16 14:36:32
阅读次数:
279
Anton is playing a very interesting computer game, but now he is stuck at one of the levels. To pass to the next level he has to prepare npotions. Ant ...
分类:
其他好文 时间:
2016-11-16 07:48:02
阅读次数:
242
Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. However, he finds the game ...
分类:
其他好文 时间:
2016-11-16 07:47:00
阅读次数:
399