CSES - Datatähti 2024 alku - Results
Submission details
Task:Säähavainnot
Sender:Laserr
Submission time:2023-11-12 21:31:59 +0200
Language:C++ (C++11)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:35:10: error: expected '}' at end of input
   35 |         }
      |          ^
input/code.cpp:29:12: note: to match this '{'
   29 | int main() {
      |            ^

Code

#include <iostream>
#include <cmath>

using namespace std;

double d[24];

void solve() {
	for (int i = 0; i < 24; i++) cin >> d[i];
	double mean = 0;
	for (int i = 0; i < 24; i++) mean += d[i];
	mean /= 23;
	double s = 0;
	for (int i = 0; i < 24; i++) s += pow(d[i] - mean, 2);

	double e = d[23];

	for (int i = 0; i < 12; i++) {
		if (56 > s && i <= 5) cout << e << " ";
		else if (41 > s && i <= 6) cout << e << " ";
		else if (25 > s && i <= 7) cout << e << " ";
		else if (18 > s && i <= 12) cout << e << " ";
		else if (i <= 4) cout << e << " ";
		else cout << "? ";
	}
	cout << endl;
}

int main() {
	int n;
	cin >> n;
	while (n) {
		n--;
		solve();
	}