为了给学弟学妹讲课,我水了一道题…… import java.util.Arrays; import java.util.Scanner; public class NYOJ540 { public static void main(String[] args) { int from, to, T; Node node[]; Scanner sc = new Scanner(System.in); T = sc.nextInt(); int temp; while(T-->0) { from =…
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=170 思路:统计每个节点的度,将度为1的节点消去所需要的最少的边即为答案. 代码: #include "stdio.h" //nyoj 170 网络的可靠性 #include "string.h" #define N 10005 int du[N]; int main() { int n; int i; int x,y; while(scanf("…