6436 | 2023-11-29 12:13:50 | Ghost | Videójáték | cpp17 | Compilation error |
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int unalom, n, m, i;
cin >> unalom >> n;
vector<pair<int, int>> szünetek(n);
for (i = 0; i < n; i++) {
cin >> szünetek[i].first >> szünetek[i].second;
}
cin >> m;
vector<pair<int, int>> Hszünetek(m);
for (i = 0; i < m; i++) {
cin >> Hszünetek[i].first >> Hszünetek[i].second;
}
i = 0;
int j = 0, out = 0;
while (i < n && j < m) {
while ((szünetek[i].first + unalom + 1) < Hszünetek[j].first) {
i++;
}
pair<int, int> current = szünetek[i], currentH = Hszünetek[j];
if (current.first < currentH.second) {
out += currentH.second - current.first;
j++;
}
if (current.second > currentH.first) {
out += current.second - currentH.first;
i++;
}
}
cout << out;
}
exit status 1
main.cpp:11:30: error: stray '\374' in program
11 | vector<pair<int, int>> sz�netek(n);
| ^
main.cpp:13:18: error: stray '\374' in program
13 | cin >> sz�netek[i].first >> sz�netek[i].second;
| ^
main.cpp:13:39: error: stray '\374' in program
13 | cin >> sz�netek[i].first >> sz�netek[i].second;
| ^
main.cpp:17:31: error: stray '\374' in program
17 | vector<pair<int, int>> Hsz�netek(m);
| ^
main.cpp:19:19: error: stray '\374' in program
19 | cin >> Hsz�netek[i].first >> Hsz�netek[i].second;
| ^
main.cpp:19:41: error: stray '\374' in program
19 | cin >> Hsz�netek[i].first >> Hsz�netek[i].second;
| ^
main.cpp:25:19: error: stray '\374' in program
25 | while ((sz�netek[i].first + unalom + 1) < Hsz�netek[j].first) {
| ...