Codeforces Round #221 (Div. 2) Lever I.O.U.
这场cf 做的很差,,第一题犯了一个很低级的错误。。把i写成了J....
第二题 想的太复杂了。。。其实我们只需要 考虑每个人自己的负债情况就行了,就是假设每个人把别人
欠他的钱,拿过来还给别人。。这就是最简单的欠债关系了。。。
在做题的过程中也没有专心。。做了以后就去干其他事了
最后就是一道题也没有过,rating已经掉的不行了。。
题目:http://codeforces.com/contest/376/problem/A
http://codeforces.com/contest/376/problem/B
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std; int main()
{
int d[];
int n,m,sum,i;
int a,b,c;
while(cin>>n>>m)
{
sum=;
memset(d,,sizeof(d));
while(m--)
{
cin>>a>>b>>c;
d[a]-=c;
d[b]+=c;
}
for(i=; i<=; i++)
if(d[i]>)
sum+=d[i];
cout<<sum<<endl;
}
return ;
}
Codeforces Round #221 (Div. 2) Lever I.O.U.的更多相关文章
- Codeforces Round #221 (Div. 1) B. Maximum Submatrix 2 dp排序
B. Maximum Submatrix 2 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset ...
- Codeforces Round #221 (Div. 2) C. Divisible by Seven(构造 大数除法 )
上几次的一道cf题. 题目:http://codeforces.com/contest/376/problem/C 性质: (4)a与b的和除以c的余数(a.b两数除以c在没有余数的情况下除外),等于 ...
- [Codeforces Round #221 (Div. 1)][D. Tree and Queries]
题目链接:375D - Tree and Queries 题目大意:给你一个有n个点的树,每个点都有其对应的颜色,给出m次询问(v,k),问v的子树中有多少种颜色至少出现k次 题解:先对所有的询问进行 ...
- Codeforces Round #221 (Div. 2) D
有点郁闷的题目,给了2000ms,可是n,m的范围已经是5000了.5000 * 5000一般在别的OJ已经是超了2000ms,一開始不敢敲.看了下别人有n*m的潜逃循环,原来CF的机子如此的强大,一 ...
- Codeforces Round #672 (Div. 2) A - C1题解
[Codeforces Round #672 (Div. 2) A - C1 ] 题目链接# A. Cubes Sorting 思路: " If Wheatley needs more th ...
- Codeforces Round #633 (Div. 2)
Codeforces Round #633(Div.2) \(A.Filling\ Diamonds\) 答案就是构成的六边形数量+1 //#pragma GCC optimize("O3& ...
- Codeforces Round #366 (Div. 2) ABC
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
- Codeforces Round #368 (Div. 2)
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...
随机推荐
- 解决 windows2012 下无法安装 sql2008R2
Press the Windows logo key, type control panel, and then click the Control Panel icon. Note If you a ...
- sql新感悟(where 1 = 1)
花了好久把YII框架看完发现一本很不错的书:SQL案例解析(清华大学出版社),看到一些比较有用的东西,感觉应该把他记录下来,看了好多页发现书中一直有 where 1=1,这样的语句,查过发现“wher ...
- mongodb命令使用
最近学习mongodb的使用,整理了一些常用命令 windows服务安装:mongod --install --serviceName MongoDB --serviceDisplayName Mon ...
- ZOJ 1074 最大子矩阵和
Description Given a two-dimensional array of positive and negative integers, a sub-rectangle is any ...
- MenuItem
private void 文件ToolStripMenuItem_Click(object sender, EventArgs e) { MessageBox.Show("打开测试" ...
- poj 2449 Remmarguts' Date(第K短路问题 Dijkstra+A*)
http://poj.org/problem?id=2449 Remmarguts' Date Time Limit: 4000MS Memory Limit: 65536K Total Subm ...
- c++ deque 双端队列
双端队列: 函数 描述 c.assign(beg,end)c.assign(n,elem) 将[beg; end)区间中的数据赋值给c.将n个elem的拷贝赋值给c. c.at(idx) 传回索引 ...
- PAT-乙级-1019. 数字黑洞 (20)
1019. 数字黑洞 (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 给定任一个各位数字不完全相同的4位 ...
- 破解之寻找OEP[手动脱壳](2)
1.使用ESP定律 OD载入后,F8一次,在寄存器窗口的ESP的内容上(如0012FFA4)右键:“在数据窗口中跟随”,到内存数据窗口,将内存数据窗口以HEX 数据形式显示,在刚才的地址起始位置上(如 ...
- 用IDEA调试Play工程
IDEA的版本是14.0.1,运行在MAC OS X Yosemite上. IDEA已经装了Scala插件,但是在新建工程中,Scala的选项中并没有Play框架,不知道什么原因. 导入Play工程 ...