CSES - Datatähti 2024 alku - Results
Submission details
Task:Lumimyrsky
Sender:Oliver2
Submission time:2023-10-30 18:57:10 +0200
Language:C++ (C++20)
Status:COMPILE ERROR

Compiler report

input/code.cpp:3:1: error: 'vector' does not name a type
    3 | vector<int> maki1(10);
      | ^~~~~~
input/code.cpp:4:1: error: 'vector' does not name a type
    4 | vector<int> maki2(10);
      | ^~~~~~
input/code.cpp: In function 'int main()':
input/code.cpp:9:24: error: 'maki1' was not declared in this scope
    9 |                 cin >> maki1[i];
      |                        ^~~~~
input/code.cpp:13:24: error: 'maki2' was not declared in this scope
   13 |                 cin >> maki2[i];
      |                        ^~~~~
input/code.cpp:18:31: error: 'maki1' was not declared in this scope
   18 |                 maki1Summa += maki1[i];
      |                               ^~~~~
input/code.cpp:19:31: error: 'maki2' was not declared in this scope
   19 |                 maki2Summa += maki2[i];
      |                               ^~~~~

Code

#include <iostream>
#include <vector>
vector<int> maki1(10);
vector<int> maki2(10);

using namespace std;
int main() {
	for (int i = 0; i < 10; i++) {
		cin >> maki1[i];

	}
	for (int i = 0; i < 10; i++) {
		cin >> maki2[i];
	}
	int maki1Summa = 0;
	int maki2Summa = 0;
	for (int i = 0; i < 10; i++) {
		maki1Summa += maki1[i];
		maki2Summa += maki2[i];
	}
	if (maki1Summa <= maki2Summa) {
		cout << "1 ";
	}
	else {
		cout << "2";
	}
}