ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1880. Psych Up's Eigenvalues

Solving with Collections
Posted by ucb.churringo 27 Aug 2013 04:18

When I run this code I get the right answer, why do I fail test #2

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class EJ1880 {

/**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
File Arc = new File("C:\\Documents and Settings\\Admin\\workspace\\ACM\\src\\timus\\datos.txt");
Scanner in = new Scanner(Arc);
//Scanner in = new Scanner(System.in);
ArrayList<Integer> L1 = new ArrayList<Integer>();
ArrayList<Integer> B1 = new ArrayList<Integer>();

//Cargar elementos
int a = in.nextInt();
for (int aux = 0; aux < a; aux++)

int b = in.nextInt();
for (int aux = 0; aux < b; aux++)

int c = in.nextInt();
for (int aux = 0; aux < c; aux++)

//Ordenar elementos
Collections.sort(L1);

for (int i = 0; i < L1.size(); i++) {
if ((Collections.frequency(L1, L1.get(i)) > 1)) {