Source code for submission s1065

Go to diff to previous submission

Fn.java

  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4.  
  5.  
  6. public class Fn {
  7.  
  8. public static void main(String[] args) throws IOException {
  9. String line;
  10. String[] lis;
  11. int points;
  12. int lines;
  13. int a;
  14. int b;
  15.  
  16. int[] p;
  17. boolean found;
  18. while((line = br.readLine()) != null){
  19. found = false;
  20.  
  21. lis = line.split(" ");
  22. points = Integer.parseInt(lis[0]);
  23. lines = Integer.parseInt(lis[1]);
  24.  
  25. p = new int[points+1];
  26.  
  27. for (int i = 0; i < lines; i++) {
  28. line = br.readLine();
  29.  
  30. lis = line.split(" ");
  31. a = Integer.parseInt(lis[0]);
  32. b = Integer.parseInt(lis[1]);
  33.  
  34. // System.out.println(a+" "+b);
  35. p[a] += 1;
  36. p[b] += 1;
  37. }
  38. for (int i = 0; i < p.length; i++) {
  39. if (p[i] == 4){
  40. System.out.println("YES");
  41. found = true;
  42. break;
  43. }
  44. }
  45.  
  46. if (!found){
  47. System.out.println("NO");
  48. }
  49.  
  50. }
  51. br.close();
  52. }
  53. }
  54.  

Diff to submission s1054

Fn.java

--- c5.s1054.cteam055.fn.java.0.Fn.java
+++ c5.s1065.cteam055.fn.java.0.Fn.java
@@ -38,5 +38,5 @@
                         }
                         for (int i = 0; i < p.length; i++) {
-                                if (p[i] >= 4){
+                                if (p[i] == 4){
                                         System.out.println("YES");
                                         found = true;