Rezultati

Up. imeNalogaJezikRezultatČas oddaje
svetatrojica-2017 Hierarhija C++ 100/100OK 11. maj '17 @ 17:01

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 3,270 MiB 0,004 s OK
#2 10/10 3,273 MiB 0,004 s OK
#3 10/10 3,109 MiB 0,004 s OK
#4 10/10 3,109 MiB 0,004 s OK
#5 10/10 3,273 MiB 0,004 s OK
#6 10/10 3,105 MiB 0,004 s OK
#7 10/10 3,273 MiB 0,004 s OK
#8 10/10 3,273 MiB 0,004 s OK
#9 10/10 3,109 MiB 0,004 s OK
#10 10/10 3,270 MiB 0,004 s OK

Ocenjevani program (hieararhija.cpp):
#include <stdio.h>
#include <string.h>
#include <math.h>

#include <iostream>
#include <vector>
#include <utility>
#include <string>
#include <algorithm>

using namespace std;

int main(){
	int n, m;
	int f;
	scanf("%d %d", &n, &m);
	printf("1");
	for (f = 2; f <= n-1-m; f++){
		printf(" %d", f);
	}
	int a = m;
	if (n - m == 1) a--;
	for (f = 0; f < a; f++){
		printf(" %d", n-m);
	}
	printf("\n");
	return 0;
}