Go to diff to previous submission
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package fn; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Scanner; /** * * @author kuric10 */ public class Main { /** * @param args the command line arguments */ // TODO code application logic here // BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); // String s=input.readLine(); // String pole[]; int poc[] = new int[10001]; //int spoje[][] int max; int prve; int druhe; int links; /* while(1==1){ prve=input.read(); input.read(); druhe=input.read(); input.read(); }*/ /* while(!s.equals(null)){ pole=s.split(" "); max=Integer.parseInt(pole[0]);//nebol bz lepsi scanner ?? links=Integer.parseInt(pole[1]); for (int i = 0; i < links; i++) { s=input.readLine(); pole } s=input.readLine(); }*/ // ArrayList<int[]> a = new ArrayList<int[]>(); int[] pomPole; int pom; boolean b; while (in.hasNextInt()) { b = false; max = in.nextInt(); links = in.nextInt(); // System.out.println(links); for (int i = 0; i < links; i++) { prve = in.nextInt(); druhe = in.nextInt(); if (prve > druhe) { pom = prve; prve = druhe; druhe = pom; } pomPole = new int[2]; pomPole[0] = prve; pomPole[1] = druhe; // // if (!a.contains(i)) { poc[prve]++; poc[druhe]++; // a.add(pomPole); if (poc[prve] == 4 || poc[druhe] == 4) { b = true; //break; } // } } if (b) { } else { } for (int i = 0; i < max + 1; i++) { poc[i] = 0; } // a.clear(); } } }
--- c5.s604.cteam085.fn.java.0.Main.java +++ c5.s612.cteam085.fn.java.0.Main.java @@ -21,7 +21,7 @@ public static void main(String[] args) throws Exception { // TODO code application logic here - BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); + // BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); // String s=input.readLine(); - String pole[]; + // String pole[]; int poc[] = new int[10001]; //int spoje[][] @@ -49,5 +49,5 @@ }*/ Scanner in = new Scanner(System.in); - ArrayList<int[]> a = new ArrayList<int[]>(); + // ArrayList<int[]> a = new ArrayList<int[]>(); int[] pomPole; int pom; @@ -70,13 +70,13 @@ pomPole[1] = druhe; // - if (!a.contains(i)) { + // if (!a.contains(i)) { poc[prve]++; poc[druhe]++; - a.add(pomPole); + // a.add(pomPole); if (poc[prve] == 4 || poc[druhe] == 4) { b = true; //break; } - } + // } } if (b) { @@ -88,5 +88,5 @@ poc[i] = 0; } - a.clear(); + // a.clear(); }