转自:http://hi.baidu.com/lff0305/blog/item/a0baae0994a719236a60fb16.html
下面两个类A,B:
package ptest;
public class A {
private void print() {
System.out.println("==========");
}
}
package ptest;
import java.lang.reflect.Method;
public class B{
public static void main(String[] args) throws Exception {
A a = A.class.newInstance();
Method m = a.getClass().getDeclaredMethod("print", new Class[]{});
m.setAccessible(true); // 这里比较......
阅读全文
The Unique MST
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 17785
Accepted: 6176
Description
Given a connected undirected graph, tell if its minimum spanning tree is unique.
Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of G, say T = (V', E'), with the following properties:
1. V' = V.
2. T is connected and acyclic.
Definition 2 (Minimum Spanning Tree): Consider an edge-weighted, connect......
阅读全文