CSES - Datatähti 2024 alku - Results
Submission details
Task:Säähavainnot
Sender:4321Boom4321
Submission time:2023-11-12 20:43:09 +0200
Language:C++ (C++11)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:27:9: error: expected ',' or ';' before 'vector'
   27 |         vector<float> s = {
      |         ^~~~~~
input/code.cpp:37:32: error: 's' was not declared in this scope
   37 |         cout << v[23] + m[0] + s[0] * (v[23] - v[22]) << " ";
      |                                ^

Code

#include <iostream>
#include <vector>
using namespace std;
int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        vector<float> v;
        for (int j = 0; j < 24; j++) {
            float a;
            cin >> a;
            v.push_back(a);
        }

        vector<float> m = {
            0.0,
            -0.01383,
            -0.11098,
            -0.29267,
            -0.495,
            -0.758,
            -1.042,
            -1.334,
        }

        vector<float> s = {
            0.1,
            0.1,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
        }

        cout << v[23] + m[0] + s[0] * (v[23] - v[22]) << " ";
        cout << v[23] + m[1] + s[1] * (v[23] - v[22]) << " ";
        cout << v[23] + m[2] + s[2] * (v[23] - v[22]) << " ";
        cout << v[23] + m[3] + s[3] * (v[23] - v[22]) << " ";
        if (abs(v[6] - v[0]) < 6.0) {
            cout << v[23] + m[4] + s[4] * (v[23] - v[22]) << " ";
        }
        else cout << "? ";
        if (abs(v[6] - v[0]) < 3.5) {
            cout << v[23] + m[5] + s[5] * (v[23] - v[22]) << " ";
        }
        else cout << "? ";
        if (abs(v[6] - v[0]) < 1.75) {
            cout << v[23] + m[6] + s[6] * (v[23] - v[22]) << " ";
        }
        else cout << "? ";
        if (abs(v[6] - v[0]) < 1.0) {
            cout << v[23] + m[7] + s[7] * (v[23] - v[22]) << " ";
        }
        else cout << "? ";
        cout << "? ? ? ? " << endl;
    }
    return 0;
}