Code Submission Evaluation System Login

Datatähti 2015 loppu

Start:2015-01-29 12:15:00
End:2015-01-29 17:15:00
 

Tasks | Scoreboard | Statistics


CSES - Datatähti 2015 loppu - Results
History
2015-01-29 13:01:01100
2015-01-29 12:57:4745
2015-01-29 12:51:2612
2015-01-29 12:50:0712
2015-01-29 12:46:3045
2015-01-29 12:43:4945
2015-01-29 12:43:19
2015-01-29 12:42:450
2015-01-29 12:42:160
2015-01-29 12:40:480
2015-01-29 12:39:380
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();
	}

}