Rezultati

Up. imeNalogaJezikRezultatČas oddaje
scoreoutofboundsexception-2019 Malica Java 100/100OK 09. maj '19 @ 16:24

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 16/16 33,574 MiB 0,000 s OK
#2 [več] 16/16 48,613 MiB 0,000 s OK
#3 [več] 17/17 38,336 MiB 0,000 s OK
#4 [več] 17/17 40,523 MiB 0,000 s OK
#5 [več] 17/17 37,594 MiB 0,000 s OK
#6 [več] 17/17 46,684 MiB 0,000 s OK

Ocenjevani program (pica.java):
import java.io.*;
import java.util.*;

public class pica {

	public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out=new PrintWriter(System.out);
		StringTokenizer st = new StringTokenizer(in.readLine());
		int n = Integer.parseInt(st.nextToken());
		int uc = Integer.parseInt(st.nextToken());
		int[][] ans = new int[uc][3];
		for (int i = 0; i < n; i++) {
			st = new StringTokenizer(in.readLine());
			int size = Integer.parseInt(st.nextToken());
			int pu = Integer.parseInt(st.nextToken()) - 1;
			for (int j = 0; j < size; j++) {
				st = new StringTokenizer(in.readLine());
				String s = st.nextToken();
				if (s.equals("sirov")) {
					ans[pu][0]++;
				} else if (s.equals("veganski")) {
					ans[pu][1]++;
				}else {
					ans[pu][2]++;
				}
			}
		}
		for(int[]q:ans) {
			for(int i:q) {
				out.print(i+" ");
			}
			out.println();
		}
		out.close();
	}

}