这场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. AngularJS(5)-Http

    $http 是 AngularJS 中的一个核心服务,用于读取远程服务器的数据 加入下面有一个存储在web服务器上的数据,假设地址为http://TestWebData/myData.php { &q ...

  2. C# 从服务器下载文件代码的几种方法

    一.//TransmitFile实现下载 protected void Button1_Click(object sender, EventArgs e) { /* 微软为Response对象提供了一 ...

  3. html标准写法

    <!--doctype指定文档类型htm--> <!doctype html> <html> <header> <!--设置字符集 utf-8-- ...

  4. python学习之html从0开始(一)

    <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content ...

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

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

  6. Qt 内存管理机制(转)

      许转载http://devbean.blog.51cto.com/448512/526734 强类型语言在创建对象时总会显式或隐式地包含对象的类型信息.也就是说,强类型语言在分配对象内存空间时,总 ...

  7. shell 实现类似php的require_once函数

    config.sh #/bin/bash require_once() { #File the true path ,To prevent a symbolic link local realpath ...

  8. Increase SharePoint Execution Timeout

    <system.web> <compilation batch="false" batchTimeout="600" maxBatchSize ...

  9. poj 2449 Remmarguts' Date(第K短路问题 Dijkstra+A*)

    http://poj.org/problem?id=2449 Remmarguts' Date Time Limit: 4000MS   Memory Limit: 65536K Total Subm ...

  10. sed 常见用法

    sed 1. 移除空白行 sed '/^$/d' file 2. 直接在文本中进行替换 sed 's/pattern/replacement/g' -i file -i[SUFFIX], --in-p ...