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”三种中任意一种就输 ...
随机推荐
- CentOS平台下为Python添加MongoDB支持PyMongo
下载PyMongo [root@leezhen ~]# wget https://pypi.python.org/packages/source/p/pymongo/pymongo-2.6.3.tar ...
- 前端encodeURIComponent 和后端http_build_query配合
解决特殊字符不能转义 1. function fixedEncodeURIComponent (str) { return encodeURIComponent(str).replace(/[!' ...
- 用python实现了一下:甲乙两人互猜数字(数理逻辑)
今天在园子里看到博客:超难面试题:甲乙两人互猜数字(数理逻辑).然后琢磨了半天,写了个Python程序实现算法,我得出来的结果是1,6或1,8或35,42的组合, 不知道是否正确,请高人指点? 下面列 ...
- 字符串转换成整型数 atoi()
题目说明: 1.设计函数: int atoi(const char *nptr); 2.功能:把字符串转换成整型数,atoi()会扫描参数nptr字符串,如果第一个非空格字符存在, 是数字或者正负号则 ...
- dell inspiorn 14vr 1616b ubuntu 无线网卡的问题
找到两个解决方法: 1 找 网卡驱动下载: 用命令 以下 from :http://zhidao.baidu.com/link?url=k6QNIdJlbRyZJSEW1cVUs_1p4Jv-73c8 ...
- PAT乙级真题1005. 继续(3n+1)猜想 (25)(解题)
原题: 卡拉兹(Callatz)猜想已经在1001中给出了描述.在这个题目里,情况稍微有些复杂. 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数.例如对n=3进行验证 ...
- HDU 1159
Description A subsequence of a given sequence is the given sequence with some elements (possible non ...
- 利用PHPRPC以及SOAP分别实现PHP的Webserver功能
服务端:phprpc服务端 <?php /* phprpc 服务端演示 * time:2014-06-23 */ require_once 'phprpc_server.php';//引入服务端 ...
- Get the item a SharePoint workflow task is associated with
This is handy. SharePoint helpfully populates the meta data with the GUID of the list and the ID of ...
- 在cmd命令行下登录本地oracle数据库与服务器上的oracle
一.本地登录 cmd->sqlplus 用户名/密码@数据库名 (as sysdba)->enter注:如果此用户名不是系统用户sys,scott,system就不需要加as sysdba ...