joi2019_ho_t4.cpp: In function 'int main()':
joi2019_ho_t4.cpp:15:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
15 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
joi2019_ho_t4.cpp:17:20: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
17 | int x, y; scanf("%d%d", &x, &y);
| ~~~~~^~~~~~~~~~~~~~~~
joi2019_ho_t4.cpp:22:33: warning: array subscript 2 is above array bounds of 'int [2]' [-Warray-bounds]
22 | if(cnt[i][1] < 1 && cnt[i][2] > 1)
| ~~~~~~~~^
joi2019_ho_t4.cpp:23:39: warning: array subscript 2 is above array bounds of 'int [2]' [-Warray-bounds]
23 | ans += 1 - cnt[i][1], cnt[i][2] += cnt[i][1] - 1, cnt[i][1] = 1;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~
joi2019_ho_t4.cpp:24:16: warning: array subscript 2 is above array bounds of 'int [2]' [-Warray-bounds]
24 | if(cnt[i][2] < 1 && cnt[i][1] > 1)
| ~~~~~~~~^
joi2019_ho_t4.cpp:25:65: warning: array subscript 2 is above array bounds of 'int [2]' [-Warray-bounds]
25 | ans += 1 - cnt[i][2], cnt[i][1] += cnt[i][2] - 1, cnt[i][2] = 1;
| ~~~~~~~~^
joi2019_ho_t4.cpp:27:24: warning: array subscript 2 is above array bounds of 'int [2]' [-Warray-bounds]
27 | ans += abs(cnt[i][2] - 1), cnt[i + 1][2] += cnt[i][2] - 1, cnt[i][2] = 1;
| ~~~~~~~~^
joi2019_ho_t4.cpp:27:46: warning: array subscript 2 is above array bounds of 'int [2]' [-Warray-bounds]
27 | ans += abs(cnt[i][2] - 1), cnt[i + 1][2] += cnt[i][2] - 1, cnt[i][2] = 1;
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
joi2019_ho_t4.cpp:27:46: warning: array subscript 2 is above array bounds of 'int [2]' [-Warray-bounds]
joi2019_ho_t4.cpp:27:72: warning: array subscript 2 is above array bounds of 'int [2]' [-Warray-bounds]
27 | ans += abs(cnt[i][2] - 1), cnt[i + 1][2] += cnt[i][2] - 1, cnt[i][2] = 1;
| ~~~~~~~~^