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 15:57:4612
2015-01-29 15:47:050
2015-01-29 15:43:400
Task:Pörssihai
Sender:juusohe
Submission time:2015-01-29 15:57:46
Language:C++
Status:READY
Score:12

Feedback

groupverdictscore
#1ACCEPTED12
#2TIME LIMIT EXCEEDED0
#3TIME LIMIT EXCEEDED0

Test results

testverdicttime (s)group
#1ACCEPTED0.13 / 5.001details
#2ACCEPTED0.13 / 5.001details
#3ACCEPTED0.12 / 5.001details
#4TIME LIMIT EXCEEDED-- / 5.002details
#5TIME LIMIT EXCEEDED-- / 5.002details
#6TIME LIMIT EXCEEDED-- / 5.002details
#7TIME LIMIT EXCEEDED-- / 5.003details
#8TIME LIMIT EXCEEDED-- / 5.003details
#9TIME LIMIT EXCEEDED-- / 5.003details
#10TIME LIMIT EXCEEDED-- / 5.003details
#11TIME LIMIT EXCEEDED-- / 5.003details
#12TIME LIMIT EXCEEDED-- / 5.003details
#13TIME LIMIT EXCEEDED-- / 5.003details
#14TIME LIMIT EXCEEDED-- / 5.003details
#15TIME LIMIT EXCEEDED-- / 5.003details
#16TIME LIMIT EXCEEDED-- / 5.003details
#17TIME LIMIT EXCEEDED-- / 5.003details
#18TIME LIMIT EXCEEDED-- / 5.003details
#19TIME LIMIT EXCEEDED-- / 5.003details
#20TIME LIMIT EXCEEDED-- / 5.003details

Code

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <string>

using namespace std;

vector<double> leikkaa(vector<double> arvot, long long maara) {
	vector<double> paluuarvo;
	for (long long i = 0; i < maara; i++) {
		paluuarvo.push_back(arvot[i]);
	}
	return paluuarvo;
}

double calc_avg(vector<double> arvot) {
	long long summa = 0;
	for (unsigned long long i = 0; i < arvot.size(); i++) {
		summa += arvot[i];
	}
	return summa / (double)arvot.size();
}

long long paras_pituus(vector<double> arvot) {
	reverse(arvot.begin(), arvot.end());
	double bestavg = 0;
	long long best_i = 0;
	for (unsigned long long i = 1; i <= arvot.size(); i++) {
		double x = calc_avg(leikkaa(arvot, i));
		if (x >= bestavg) {
			bestavg = x;
			best_i = i;
		}
	}
	return best_i;
}

int main() {
	
	cin.sync_with_stdio(false);
	
	long long maara = 0;
	vector<double> arvot;
	
	cin >> maara;
	
	for (long long i = 0; i < maara; i++) {
		double x;
		cin >> x;
		arvot.push_back(x);
	}
	
	for (long long i = 0; i < maara; i++) {
		if (i == 0) cout << "1 ";
		else cout << paras_pituus(leikkaa(arvot, i + 1)) << ' ';
	}
	
	cout << '\n';
}

Test details

Test 1

Group: 1

Verdict: ACCEPTED

input
200
5986 845897 759781 171305 7836...
view   save

correct output
1 1 2 3 4 1 1 2 4 1 2 1 2 5 6 ...
view   save

user output
1 1 2 3 4 1 1 2 4 1 2 1 2 5 6 ...
view   save

Test 2

Group: 1

Verdict: ACCEPTED

input
200
607815 909742 130099 813674 34...
view   save

correct output
1 1 3 1 5 1 1 3 4 5 1 1 1 4 10...
view   save

user output
1 1 3 1 5 1 1 3 4 5 1 1 1 4 10...
view   save

Test 3

Group: 1

Verdict: ACCEPTED

input
200
921591 381013 930275 151815 69...
view   save

correct output
1 2 1 4 5 1 2 3 4 1 2 7 1 2 3 ...
view   save

user output
1 2 1 4 5 1 2 3 4 1 2 7 1 2 3 ...
view   save

Test 4

Group: 2

Verdict: TIME LIMIT EXCEEDED

input
5000
952303 272950 268680 897180 13...
view   save

correct output
1 2 3 1 2 1 4 8 9 10 1 2 13 14...
view   save

user output
(empty)

Test 5

Group: 2

Verdict: TIME LIMIT EXCEEDED

input
5000
815856 460818 496023 308974 33...
view   save

correct output
1 2 3 4 5 1 1 2 9 1 11 12 13 1...
view   save

user output
(empty)

Test 6

Group: 2

Verdict: TIME LIMIT EXCEEDED

input
5000
4889 373080 366119 72135 10214...
view   save

correct output
1 1 2 3 4 1 1 2 3 4 5 1 2 3 1 ...
view   save

user output
(empty)

Test 7

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
444890 370930 385763 316218 44...
view   save

correct output
1 2 3 4 1 2 3 4 9 1 2 1 4 5 6 ...
view   save

user output
(empty)

Test 8

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
202077 270536 246808 189471 19...
view   save

correct output
1 1 2 3 4 1 1 3 4 5 1 2 8 9 10...
view   save

user output
(empty)

Test 9

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
736301 784710 628727 708231 64...
view   save

correct output
1 1 3 4 5 6 7 1 2 1 4 1 1 7 1 ...
view   save

user output
(empty)

Test 10

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
242104 238293 242641 242281 24...
view   save

correct output
1 2 1 2 3 1 2 3 1 2 1 4 11 12 ...
view   save

user output
(empty)

Test 11

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
252952 189698 245317 275463 24...
view   save

correct output
1 2 1 1 2 4 7 1 2 3 1 2 3 1 1 ...
view   save

user output
(empty)

Test 12

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
214451 357457 213436 351167 21...
view   save

correct output
1 1 2 1 4 5 6 7 8 9 1 1 3 4 5 ...
view   save

user output
(empty)

Test 13

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
363703 361248 358992 356404 35...
view   save

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

user output
(empty)

Test 14

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
718920 716974 715476 714540 71...
view   save

correct output
1 2 3 4 5 6 7 1 1 1 1 1 1 1 1 ...
view   save

user output
(empty)

Test 15

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
614078 647174 701983 580935 58...
view   save

correct output
1 1 1 3 4 1 6 8 9 1 1 3 4 14 1...
view   save

user output
(empty)

Test 16

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
788376 788632 788880 789118 78...
view   save

correct output
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
view   save

user output
(empty)

Test 17

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
711774 711541 711305 711627 71...
view   save

correct output
1 2 3 1 2 6 1 2 1 2 3 6 7 1 2 ...
view   save

user output
(empty)

Test 18

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
685798 944128 587123 653271 65...
view   save

correct output
1 1 2 3 4 1 2 7 8 10 11 1 1 3 ...
view   save

user output
(empty)

Test 19

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
734074 734109 733868 733873 73...
view   save

correct output
1 1 3 4 5 1 1 1 1 1 1 1 3 5 6 ...
view   save

user output
(empty)

Test 20

Group: 3

Verdict: TIME LIMIT EXCEEDED

input
1000000
143117 1 267468 262833 141471 ...
view   save

correct output
1 2 1 2 3 1 1 2 4 1 2 10 11 12...
view   save

user output
(empty)