Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 16/16 37,078 MiB 0,000 s OK
#2 [več] 16/16 54,348 MiB 0,291 s OK
#3 [več] 17/17 37,277 MiB 0,000 s OK
#4 [več] 17/17 39,359 MiB 0,000 s OK
#5 [več] 17/17 37,938 MiB 0,000 s OK
#6 [več] 17/17 54,840 MiB 0,165 s OK

Ocenjevani program (Sandwitch.java):
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Sandwitch {

	public static void main(String[] args) {
		int n;
		int r;
		String dump="";
		BufferedReader s= new BufferedReader(new InputStreamReader(System.in));
		
		try {
			dump=s.readLine();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		String[] inps= dump.split(" ");
		n=Integer.parseInt(inps[0]);
		r=Integer.parseInt(inps[1]);
		int[][] san_num = new int [r+1][3];
		for(int i=0;i<n;i++) {
			String inp="";
			try {
				inp=s.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			String[] spl=inp.split(" ");
			int m=Integer.parseInt(spl[0]);
			int rn = Integer.parseInt(spl[1]);
			
				for(int j=0;j<m;j++) {
					
					try {
						inp=s.readLine();
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					spl=inp.split(" ");
					if(spl[0].equals("sirov")) {
						san_num[rn][0]++;
					}
					else if(spl[0].equals("veganski")) {
						san_num[rn][1]++;
					}else {
						san_num[rn][2]++;
					}
				}
		}
		for(int i=1;i<=r;i++) {
			System.out.println(san_num[i][0]+" "+san_num[i][1]+" "+san_num[i][2]);
		}

	}

}