1 8 1 1 1 1 1 1 1 1 2 1 2 1 1 2 2 2 1 1 2 1 2 2 2 1
1 1 1 1 2 1 1 2 2 2 1 1 2 2 1
import java.util.Comparator; import java.util.Iterator; import java.util.Scanner; import java.util.TreeSet; public class Main{//张燚 一种排序 Accepted 151 2776 java 08-06 21:56:07 nyoj public static void main(String[] args) { Scanner input=new Scanner(System.in); int N=input.nextInt(); while(N-->0){ int n=input.nextInt(); TreeSet ts=new TreeSet(new SORT()); for(int i=0;i<n;i++){ int a=input.nextInt(); int b=input.nextInt(); int c=input.nextInt(); if(b<c){ int d=b; b=c; c=d; } F f=new F(a,b,c); ts.add(f); } Iterator it=ts.iterator(); F f[]=new F[n+1]; int e=-1; while(it.hasNext()){ F r=(F)it.next(); if(e==-1){ f[++e]=r; } else if(!(r.bianhao==f[e].bianhao&&r.c==f[e].c&&r.k==f[e].k)){ f[++e]=r; } } for(int i=0;i<=e;i++){ System.out.println(f[i].bianhao+" "+f[i].c+" "+f[i].k); } } } } class SORT implements Comparator<F>{ @Override public int compare(F o1, F o2) { if(o1.bianhao>o2.bianhao) return 1; else if(o1.bianhao==o2.bianhao&&o1.c>o2.c) return 1; else if(o1.bianhao==o2.bianhao&&o1.c==o2.c&&o1.k>o2.k) return 1; else return -1; } } class F{ int bianhao,c,k; F(int bianhao,int c,int k){ this.bianhao=bianhao; this.c=c; this.k=k; } F(){} }
import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; public class Main{//一种排序 Accepted 215MS 2771 java 2013-08-07 09:41:06 public static void main(String[] args) { Scanner input=new Scanner(System.in); int N=input.nextInt(); while(N-->0){ int n=input.nextInt(); F f[]=new F[n]; for(int i=0;i<n;i++){ int a=input.nextInt(); int b=input.nextInt(); int c=input.nextInt(); if(b<c){ int d=b; b=c; c=d; } f[i]=new F(a,b,c); } Arrays.sort(f,new SORT()); for(int i=0;i<n;i++){ if(i==0) System.out.println(f[i].bianhao+" "+f[i].c+" "+f[i].k); else if(!(f[i].bianhao==f[i-1].bianhao&&f[i].c==f[i-1].c&&f[i].k==f[i-1].k)){ System.out.println(f[i].bianhao+" "+f[i].c+" "+f[i].k); } } } } } class SORT implements Comparator<F>{ @Override public int compare(F o1, F o2) { if(o1.bianhao>o2.bianhao) return 1; else if(o1.bianhao==o2.bianhao&&o1.c>o2.c) return 1; else if(o1.bianhao==o2.bianhao&&o1.c==o2.c&&o1.k>o2.k) return 1; else return -1; } } class F{ int bianhao,c,k; F(int bianhao,int c,int k){ this.bianhao=bianhao; this.c=c; this.k=k; } F(){} }
import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; public class Main{//一种排序 Accepted 313MS 2771 java 2013-08-07 09:57:57 public static void main(String[] args) { Scanner input=new Scanner(System.in); int N=input.nextInt(); while(N-->0){ int n=input.nextInt(); F f[]=new F[n]; for(int i=0;i<n;i++){ int a=input.nextInt(); int b=input.nextInt(); int c=input.nextInt(); if(b<c){ int d=b; b=c; c=d; } f[i]=new F(a,b,c); } Arrays.sort(f,new Comparator<F>(){ @Override public int compare(F o1, F o2) { if(o1.bianhao>o2.bianhao) return 1; else if(o1.bianhao==o2.bianhao&&o1.c>o2.c) return 1; else if(o1.bianhao==o2.bianhao&&o1.c==o2.c&&o1.k>o2.k) return 1; else return -1; } }); for(int i=0;i<n;i++){ if(i==0) System.out.println(f[i].bianhao+" "+f[i].c+" "+f[i].k); else if(!(f[i].bianhao==f[i-1].bianhao&&f[i].c==f[i-1].c&&f[i].k==f[i-1].k)){ System.out.println(f[i].bianhao+" "+f[i].c+" "+f[i].k); } } } } } class F{ int bianhao,c,k; F(int bianhao,int c,int k){ this.bianhao=bianhao; this.c=c; this.k=k; } F(){} }