[Offer收割]编程练习赛107 register

Ended

Participants:61

Verdict:Accepted
Score:100 / 100
Submitted:2019-09-01 13:23:03

Lang:Java

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;
public class Main {
    public static void main(String[] argsthrows Exception {
        new Main().run();}
    static class Edge implements Comparable{
        int v;
        int w;
        int next;
        public Edge(int v,int w,int next){
            this.v = v;
            this.w = w;
            this.next = next;
        }
        @Override
        public int compareTo(Object o) {
            Edge other = (Edge)o;
            if(this.w==other.wreturn Integer.compare(this.v,other.v);
            else return Integer.compare(this.w,other.w);
        }
    }
    static int head[];
    static Edge edges[];
    static int count = 0;
    public static void addEdge(int u,int vint w){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX