joi2019_ho_t4.cpp: In function 'void solve()':
joi2019_ho_t4.cpp:20:16: error: 'n' was not declared in this scope; did you mean 'yn'?
20 | cin >> n;
| ^
| yn
joi2019_ho_t4.cpp:21:14: error: 'i' was not declared in this scope
21 | for (i = 1; i <= 2*n; i++) {
| ^
joi2019_ho_t4.cpp:25:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
25 | if (x < 1) ans += 1 - x, x = 1;
| ^~~
| abs
joi2019_ho_t4.cpp:26:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
26 | else if (x > n) ans += x - n, x = n;
| ^~~
| abs
joi2019_ho_t4.cpp:28:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
28 | if (y < 1) ans += 1 - y, y = 1;
| ^~~
| abs
joi2019_ho_t4.cpp:29:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
29 | else if (y > 2) ans += y - 2, y = 2;
| ^~~
| abs
joi2019_ho_t4.cpp:34:14: error: 'i' was not declared in this scope
34 | for (i = 1; i <= n; i++) {
| ^
joi2019_ho_t4.cpp:35:17: error: 'a' was not declared in this scope
35 | a += m[i][1] - 1, b += m[i][2] - 1;
| ^
joi2019_ho_t4.cpp:35:35: error: 'b' was not declared in this scope
35 | a += m[i][1] - 1, b += m[i][2] - 1;
| ^
joi2019_ho_t4.cpp:36:51: error: 'ans' was not declared in this scope; did you mean 'abs'?
36 | while (a > 0 && b < 0) {a--; b++; ans++;}
| ^~~
| abs
joi2019_ho_t4.cpp:37:51: error: 'ans' was not declared in this scope; did you mean 'abs'?
37 | while (a < 0 && b > 0) {a++, b--, ans++;}
| ^~~
| abs
joi2019_ho_t4.cpp:38:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
38 | ans += abs(a) + abs(b);
| ^~~
| abs
joi2019_ho_t4.cpp:40:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
40 | cout << ans;
| ^~~
| abs