Task: | Lumimyrsky |
Sender: | perusjuntti |
Submission time: | 2023-11-03 12:19:13 +0200 |
Language: | C++ (C++11) |
Status: | COMPILE ERROR |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:5:19: error: 'n' was not declared in this scope 5 | vector<int> a(n), b(n); | ^
Code
#include <bits/stdc++.h> using namespace std; int main() { vector<int> a(n), b(n); for (int &i:a) cin >> i; for (int &i:b) cin >> i; int A = 0, B = 0, preva = a[0], prevb = b[0]; for (int i = 1; i < 10; ++i) { A += (a[i] > preva) * (a[i]-preva); B += (b[i] > prevb) * (b[i]-prevb); preva = a[i]; prevb = b[i]; } cout << (A < B ? 1 : 2) << '\n'; }