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 17:14:470
2015-01-29 17:14:11
2015-01-29 17:12:310
2015-01-29 16:47:440
2015-01-29 14:55:120
2015-01-29 14:52:460
2015-01-29 14:40:170
2015-01-29 14:29:480
2015-01-29 12:49:070
2015-01-29 12:46:470
Task:Urkupillit
Sender:Dentosal
Submission time:2015-01-29 17:14:47
Language:C++
Status:READY
Score:0

Feedback

groupverdictscore
#1WRONG ANSWER0
#2WRONG ANSWER0
#3WRONG ANSWER0

Test results

testverdicttime (s)group
#1WRONG ANSWER0.05 / 2.001details
#2WRONG ANSWER0.07 / 2.001details
#3WRONG ANSWER0.06 / 2.001details
#4WRONG ANSWER0.07 / 2.001details
#5WRONG ANSWER0.06 / 2.001details
#6WRONG ANSWER0.07 / 2.002details
#7WRONG ANSWER0.06 / 2.002details
#8WRONG ANSWER0.06 / 2.002details
#9WRONG ANSWER0.05 / 2.002details
#10WRONG ANSWER0.06 / 2.002details
#11WRONG ANSWER0.09 / 2.003details
#12WRONG ANSWER0.09 / 2.003details
#13WRONG ANSWER0.09 / 2.003details
#14WRONG ANSWER0.11 / 2.003details
#15WRONG ANSWER0.10 / 2.003details

Code

#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

unsigned int urut[100001];
unsigned int n;
unsigned int k;

inline bool isDone() {
	unsigned int pairs=0;
	if (n<2) {return 0;}
	for (unsigned int i=1; i<n; ++i) {
		if (urut[i-1]>urut[i]) {
			++pairs;
		}
	}
	return (pairs==k);
}



int main() {
	cin >> n;
	cin >> k;


	for (unsigned int i = 0; i < n; ++i) {
		urut[i] = i+1;
	}


	while (!isDone) random_shuffle(urut, urut+n);



	for (unsigned int i=0; i<n; ++i){cout << urut[i]+1 << " ";}
	cout << endl;




	return 0;
}

Test details

Test 1

Group: 1

Verdict: WRONG ANSWER

input
5 0

view   save

correct output
1 2 3 4 5 

view   save

user output
2 3 4 5 6 

view   save

Test 2

Group: 1

Verdict: WRONG ANSWER

input
5 10

view   save

correct output
5 4 3 2 1 

view   save

user output
2 3 4 5 6 

view   save

Test 3

Group: 1

Verdict: WRONG ANSWER

input
5 3

view   save

correct output
4 1 2 3 5 

view   save

user output
2 3 4 5 6 

view   save

Test 4

Group: 1

Verdict: WRONG ANSWER

input
5 1

view   save

correct output
2 1 3 4 5 

view   save

user output
2 3 4 5 6 

view   save

Test 5

Group: 1

Verdict: WRONG ANSWER

input
5 2

view   save

correct output
3 1 2 4 5 

view   save

user output
2 3 4 5 6 

view   save

Test 6

Group: 2

Verdict: WRONG ANSWER

input
100 0

view   save

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...
view   save

user output
2 3 4 5 6 7 8 9 10 11 12 13 14...
view   save

Test 7

Group: 2

Verdict: WRONG ANSWER

input
100 4950

view   save

correct output
100 99 98 97 96 95 94 93 92 91...
view   save

user output
2 3 4 5 6 7 8 9 10 11 12 13 14...
view   save

Test 8

Group: 2

Verdict: WRONG ANSWER

input
100 2279

view   save

correct output
100 99 98 97 96 95 94 93 92 91...
view   save

user output
2 3 4 5 6 7 8 9 10 11 12 13 14...
view   save

Test 9

Group: 2

Verdict: WRONG ANSWER

input
100 2528

view   save

correct output
100 99 98 97 96 95 94 93 92 91...
view   save

user output
2 3 4 5 6 7 8 9 10 11 12 13 14...
view   save

Test 10

Group: 2

Verdict: WRONG ANSWER

input
100 4483

view   save

correct output
100 99 98 97 96 95 94 93 92 91...
view   save

user output
2 3 4 5 6 7 8 9 10 11 12 13 14...
view   save

Test 11

Group: 3

Verdict: WRONG ANSWER

input
100000 0

view   save

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...
view   save

user output
2 3 4 5 6 7 8 9 10 11 12 13 14...
view   save

Test 12

Group: 3

Verdict: WRONG ANSWER

input
100000 4999950000

view   save

correct output
100000 99999 99998 99997 99996...
view   save

user output
2 3 4 5 6 7 8 9 10 11 12 13 14...
view   save

Test 13

Group: 3

Verdict: WRONG ANSWER

input
100000 2969035543

view   save

correct output
100000 99999 99998 99997 99996...
view   save

user output
2 3 4 5 6 7 8 9 10 11 12 13 14...
view   save

Test 14

Group: 3

Verdict: WRONG ANSWER

input
100000 2495939870

view   save

correct output
100000 99999 99998 99997 99996...
view   save

user output
2 3 4 5 6 7 8 9 10 11 12 13 14...
view   save

Test 15

Group: 3

Verdict: WRONG ANSWER

input
100000 1279770330

view   save

correct output
100000 99999 99998 99997 99996...
view   save

user output
2 3 4 5 6 7 8 9 10 11 12 13 14...
view   save