CSES - Datatähti 2015 loppu - Results
Submission details
Task:Urkupillit
Sender:Nameci2718_
Submission time:2015-01-29 12:43:19
Language:Java
Status:COMPILE ERROR

Compiler report

input/Main.java:1: error: illegal character: '\ufeff'
?
^
1 error

Code



public class Main {

	public static void main(String[] args) {
		IO io = new IO();
		
		int n = io.nextInt();
		int k = io.nextInt();
		
		boolean[] numbers = new boolean[n];
		
		for (int i = n-1; i >= 0; i--) {
			if(k >= i) {
				k -= (i);
				numbers[i] = true;
				io.print((i+1)+" ");
			}
		}
		
		for (int i = 0; i < n; i++) {
			if(!numbers[i]) io.print((i+1)+" ");
		}
		
		io.close();
	}

}