![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
STL 入门之骚操作
Jianbagengmu
换了id,换了我的人生的态度.
展开
-
UVA11300:Spreading the Wealth
代数推导 题意:将所有人的硬币进行一次平均分配,这里要注意的是,每个人只能和左右相邻的人交换硬币,而且这些人组成的是一个环解法:首先求出平均数为M每个人初始的硬币为Ai那么对于1,他能给予4号x1个硬币,并从2号出得到x2个硬币,那么对于1可得Ai-x1+x2 = M同理可得An-xn+x1 = M对上述的式子进行转化,可得1:x2 =x1-C1 (C1 = A1 - M)2:x3 = M-A2原创 2017-05-07 21:36:20 · 326 阅读 · 0 评论 -
UVA 11729 STL - Commando War
水 贪心,主要用下STL#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<string>#include<algorithm>#include<stack>#include<queue>#include<cctype>#include<functional>using namesp原创 2017-05-07 19:39:42 · 191 阅读 · 0 评论 -
A. Restoring Password
A. Restoring Passwordtime limit per test 2 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputIgor K. always used to trust his favorite Kashpirovsky Antivirus. That原创 2017-07-08 09:34:24 · 336 阅读 · 0 评论