hdu54235423 Rikka with Tree
来源:互联网 发布:菜鸟云打印控件 mac 编辑:程序博客网 时间:2024/05/17 06:59
你这都第几次看错题了?!能不能认真点?!上点心!!题意说
特殊的当且仅当不存在一棵和它不同的树和它相似等价于形如一条龙,除了最后一层可以有多个节点,其它层只能有一个节点
反正你读错题了->_->读对了也想不到这么解,也就这水平了 呵呵 怪不得rating做一场低好几十
#include <iostream>#include <stdio.h>#include <string.h>#include<set>#include<vector>#include <algorithm>using namespace std;int main(){ int n; while(cin>>n){ typedef set<int>b; b a[1005]; // std::set<std::a<int,1000>> int u,v,nn=n; bool flag=1; for(int i=0;i<n-1;i++){ cin>>u>>v; a[u].insert(v); } for(int i=1;i<1002;i++){ if(a[i].size()>1){ for(set<int>::iterator j=a[i].begin();j!=a[i].end();++j){ int t=*j; int d=a[t].size(); if(d!=0){flag=0;break;} } } } if(flag)cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0;}
0 0
- hdu54235423 Rikka with Tree
- HDU5423 Rikka with Tree
- Rikka with Tree HDU
- hdu5423 Rikka with Tree
- Rikka with Tree
- hdu 5423 Rikka with Tree
- hdu 5423 Rikka with Tree
- hdu 5423 Rikka with Tree
- HDU 5423 Rikka with Tree
- HDU 5423 Rikka with Tree(构造)
- HDU 5423:Rikka with Tree Dijkstra算法
- hdu5423 Rikka with Tree(DFS)
- HDU 5423 Rikka with Tree(水题)
- hdu 5423 Rikka with Tree 乱搞
- hdu 5423 Rikka with Tree(深搜)
- hdu 5423 Rikka with Tree DFS
- hdu 5423 Rikka with Tree(dfs)
- HDU 5423 Rikka with Tree(DFS)
- 区间素数个数 树状数组 HIT 1867 经理的烦恼
- 【OpenCV入门教程之十六】OpenCV角点检测之Harris角点检测
- 记一次电脑没网络,使用wireless获取“免费上网权限”
- 编程经验杂谈
- 二叉树的建立
- hdu54235423 Rikka with Tree
- Java-控制循环结构
- 【OpenCV入门教程之十七】OpenCV重映射 & SURF特征点检测合辑
- Python计算代码段的时间
- 如何使用iOS AddressBook
- 【Objective-C】类方法与对象方法
- 读书笔记之linux/unix系统编程手册(31)
- HDU 1018 Big Number(斯特林公式)
- Set Difference(所有子集的最值差)