这场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.的更多相关文章

  1. 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 ...

  2. Codeforces Round #221 (Div. 2) C. Divisible by Seven(构造 大数除法 )

    上几次的一道cf题. 题目:http://codeforces.com/contest/376/problem/C 性质: (4)a与b的和除以c的余数(a.b两数除以c在没有余数的情况下除外),等于 ...

  3. [Codeforces Round #221 (Div. 1)][D. Tree and Queries]

    题目链接:375D - Tree and Queries 题目大意:给你一个有n个点的树,每个点都有其对应的颜色,给出m次询问(v,k),问v的子树中有多少种颜色至少出现k次 题解:先对所有的询问进行 ...

  4. Codeforces Round #221 (Div. 2) D

    有点郁闷的题目,给了2000ms,可是n,m的范围已经是5000了.5000 * 5000一般在别的OJ已经是超了2000ms,一開始不敢敲.看了下别人有n*m的潜逃循环,原来CF的机子如此的强大,一 ...

  5. Codeforces Round #672 (Div. 2) A - C1题解

    [Codeforces Round #672 (Div. 2) A - C1 ] 题目链接# A. Cubes Sorting 思路: " If Wheatley needs more th ...

  6. Codeforces Round #633 (Div. 2)

    Codeforces Round #633(Div.2) \(A.Filling\ Diamonds\) 答案就是构成的六边形数量+1 //#pragma GCC optimize("O3& ...

  7. 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 ...

  8. Codeforces Round #354 (Div. 2) ABCD

    Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/out ...

  9. Codeforces Round #368 (Div. 2)

    直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...

随机推荐

  1. Looper Handler 多线程

    Looper is created by default on main UI    Property:        // main ui thread, if Looper is initiali ...

  2. 使用GruntJS构建Web程序

    Gruntjs是JavaScript项目的构建工具,也是基于node的一个命令行工具.很多开源JS项目都是使用它搭建.如jQuery.Qunit.CanJS等.它有以下作用 合并JS文件 压缩JS文件 ...

  3. apache配置网站目录的读写权限

    分享下apache中配置网站目录文件权限的方法. 假设http服务器运行用户和用户组是www,网站用户为centos,网站根目录是/home/centos/web. 操作方法与步骤:1,首先,设定网站 ...

  4. C# 学习之旅(3) --- 会说话的简易计算器

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  5. lazy instructor

    Description A math instructor is too lazy to grade a question in the exam papers in which students a ...

  6. GridView控件RowDataBound事件中获取列字段值的几种途径

    前台: <asp:TemplateField HeaderText="充值总额|账号余额"> <ItemTemplate> <asp:Label ID ...

  7. 友盟分享在appdelegate中的调用语句举例

    //友盟 [UMSocialData setAppKey:UmengAppkey]; [UMSocialConfig setSupportedInterfaceOrientations:UIInter ...

  8. bnu 4358 左手定则 (搜索)

    http://www.bnuoj.com/bnuoj/problem_show.php?pid=4358 [题意]:给定起始位置和方向和目的地,按照左转.前进.右转.后退的优先级递减,也就是说能左转就 ...

  9. java 凯撒大帝密码

    古罗马皇帝凯撒在打仗时曾经使用过以下方法加密军事情报:

  10. Delaunay三角剖分

    Bowyer-Watson算法:1.假设已经生成了连接若干个顶点的Delaunay三角网格:2.加入一个新的节点,找出所有外接圆包含新加入节点的三角形,并将这些三角形删除形成一个空洞:3.空洞的节点与 ...