Rezultati

Up. imeNalogaJezikRezultatČas oddaje
pomaranca-2017 Hierarhija Java 100/100OK 11. maj '17 @ 17:02

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 36,730 MiB 0,000 s OK
#2 10/10 33,555 MiB 0,000 s OK
#3 10/10 33,914 MiB 0,000 s OK
#4 10/10 50,973 MiB 0,000 s OK
#5 10/10 45,203 MiB 0,000 s OK
#6 10/10 46,121 MiB 0,000 s OK
#7 10/10 42,566 MiB 0,000 s OK
#8 10/10 50,789 MiB 0,000 s OK
#9 10/10 50,813 MiB 0,000 s OK
#10 10/10 44,906 MiB 0,000 s OK

Ocenjevani program (hierarhija.java):
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class hierarhija {
	public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args) throws NumberFormatException, IOException {
		int n = 0, m = 0;
		String[] tmp = br.readLine().split(" ");
		n = Integer.parseInt(tmp[0]);
		m = Integer.parseInt(tmp[1]);
//		System.out.println(n + " " + m);
		
		String result = "";
		for (int i = 0; i <= n-m-1; i++){
			result+=(i+1) + " ";
		}
		for (int i = 0; i < m-1; i++){
			if (i == m-1){
				result+="1";
			} else {
			result+="1 ";
			}
		}
		System.out.println(result);
		
	}
}