题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=170

根据题意,需要找到度数为1的结点个数,如下图:

#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
using namespace std;
#define N 10002

vector<int> g[N];

int main()
{
    freopen("d:\\in.txt", "r", stdin);
    int n;
    while(~scanf("%d", &n)) {
        int a, b;
        ; i<n+; i++){
            g[i].clear();
        }
        ; i<n-; i++){
            scanf("%d%d", &a, &b);
            g[a].push_back(b);
            g[b].push_back(a);
        }
        ;//度为1的个数
        ; i<=n; i++){
            )
                tot++;
        }
        printf()/);
    }
}

[河南省ACM省赛-第三届] 网络的可靠性 (nyoj 170)的更多相关文章

  1. [河南省ACM省赛-第三届] 房间安排 (nyoj 168)

    题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=168 分析:找到一天中需要最多的房间即可 #include<iostream> ...

  2. [河南省ACM省赛-第三届] AMAZING AUCTION (nyoj 251)

    题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=251 规则: 1.若某竞标价唯一,则胜出 2.若不存在唯一竞标价,则投标次数最少竞标价中标 ...

  3. [河南省ACM省赛-第三届] BUYING FEED (nyoj 248)

    #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> us ...

  4. [河南省ACM省赛-第三届] 聪明的kk (nyoj 171)

    题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=171 动态规划: d(i,j) = max{d(i-1, j), d(i, j-1)}+m ...

  5. [河南省ACM省赛-第三届] 素数 (nyoj 169)

    #include <iostream> #include <cstdio> #include <queue> #include <cstring> #i ...

  6. [河南省ACM省赛-第四届] 序号互换 (nyoj 303)

    相似与27进制的转换 #include<iostream> #include<cstdio> #include<cstring> #include<strin ...

  7. [河南省ACM省赛-第四届] 表达式求值(nyoj 305)

    栈的模拟应用: #include<iostream> #include<cstdio> #include<cstring> #include<string&g ...

  8. Mine Number(搜索,暴力) ACM省赛第三届 G

    Mine Number Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Every one once played the gam ...

  9. 2017南开ACM校赛(网络赛) 民间题解

    orz 首先说一下这个只是民间题解,可能会有很多错误 程序还没有评测,所以可能存在问题 C题比赛的时候没想到..后来发现是个模板题,所以没有代码 希望这份题解能对读者有所启发吧... A题 直接倒序枚 ...

随机推荐

  1. mac os 上安装mysqldb血泪史

    昨天下午在mac上安装mysql-python一直未遂今天查了很多资料终于成功了 最后还是在stackoverflow点击打开链接(好网站啊,一般有什么技术问题在这都能找到)上找到了答案,废话少数: ...

  2. 使用 ASP.NET MVC 4, EF, Knockoutjs and Bootstrap 设计和开发站点 - 6 - 业务逻辑

    翻译:使用 ASP.NET MVC 4, EF, Knockoutjs and Bootstrap 设计和开发站点 - 6 - 业务逻辑 Part 3: 设计逻辑层:核心开发 如前所述,我们的解决方案 ...

  3. Scope and Namespace

    Python基础-作用域和命名空间(Scope and Namespace) 在Python中,对象是独立的,不同作用域中的不同名字都可以被绑定在同一个对象上,当然对这个对象的修改会影响所有的引用.赋 ...

  4. Workflow:自定义工作流 之 模型选择

    Workflow:自定义工作流 之 模型选择 背景 毕业5年,做了4个版本的工作流框架,工作流几乎是每个企业应用开发人员必须跨过的门槛(我还没有跨过去),下面简要说一下之前的4个版本,然后重点介绍第5 ...

  5. Windows Store 手势编程小结

    Windows Store 手势编程小结 最近完成了一个Windows Store上面的手势操作的页面.在这里总结了一下经验和心得,希望能和大家一起分享和讨论一下. 首先,要纠正一个误区,在Windo ...

  6. kinect (oldest one) (libfreenect with py_kinect) on linux ubuntu14.04 x64

    freenect libs Where is the resource? Here :P : https://github.com/OpenKinect/libfreenect To make sur ...

  7. Good Vim plugin for python [Vim python mode]

    Here I got a very neat plugin for vim which is awesome indeed. It's from youtube years before. So le ...

  8. ssh三大框架,三层架构 整合测试!完整分页代码,JdbcTemplate等测试,存储过程调用,留着以后复习吧

    下载地址:http://download.csdn.net/detail/liangrui1988/5760453

  9. Android Device Chooser中显示Target unknown解决方法

    手机插在电脑上准备调试程序来着,通过eclipse运行时,弹出的Android Device Chooser中显示设备名是?????,Target未知,无法继续运行. 可以通过以下步骤解决(Ubunt ...

  10. stata

    1.只打开部分变量: use var1 var2 using "C:\data\2014.dta" 2.打开部分样本(5~10个样本) use "C:\data\2014 ...