Rezultati

Up. imeNalogaJezikRezultatČas oddaje
avokado-2018 Plezalne smeri Java 100/100OK 13. okt '18 @ 12:00

Test Točke Porabljen spomin Porabljen čas Status
#1 50/50 37,125 MiB 0,000 s OK
#2 50/50 34,461 MiB 0,000 s OK

Ocenjevani program (resitev2.java):
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.Vector;

public class resitev2 {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String first = br.readLine();

		int stevilo = Integer.parseInt(first);
		
		HashMap<String, Integer> values = new HashMap<String, Integer>();
		
		String[] order = {"I", "II", "III",
				 "IV",  "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"};
		
		for (int i = 0; i < order.length; i++) {
			String rimska = order[i];
			values.put(order[i], i*3+1);
			values.put("+"+order[i], i*3+2);
			values.put("-"+order[i], (i*3));
			values.put(order[i]+"+", i*3+2);
			values.put(order[i]+"-", (i*3));
		}
		String[][] podatki = new String[stevilo][2];

		for (int i = 0; i < stevilo; i++) {
			String podatek = br.readLine();
			podatki[i] = podatek.split(" ");
					
		}
		
		Vector<Vector<String>> vektor = new Vector<Vector<String>>();
		for (int i = 0; i < 36; i++) {
			vektor.add(new Vector<String>());
		}
		
		for (int i = 0; i < podatki.length; i++) {
			vektor.get(values.get(podatki[i][1])).add(podatki[i][0]);
		}
		comp comp = new comp();
		for (int i = 0; i < vektor.size(); i++) {
			vektor.get(i).sort(comp);
			for(int j = 0; j < vektor.get(i).size(); j++ ) {
				System.out.println(vektor.get(i).get(j));
			}
		}
				
	}

}

class comp implements Comparator<String> {

	@Override
	public int compare(String arg0, String arg1) {
		return arg0.compareTo(arg1);
	}
	
}