lamp.cpp: In function 'int main()':
lamp.cpp:24:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
24 | freopen(task ".INP", "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
lamp.cpp:25:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
25 | freopen(task ".OUT", "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
lamp.cpp:49:93: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
49 | f[i][j][k] = min(f[i][j][k], f[i - 1][tj][tk] + (j and j != tj) + (k and !tk));
| ~~~~~~~~~~~~~~~^
lamp.cpp:47:52: note: within this loop
47 | for(int tj = 0; tj < 3; tj++) {
| ~~~^~~
lamp.cpp:34:36: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
34 | f[0][j][k] = inf;
| ~~~~~~~~~~~^~~~~
lamp.cpp:32:26: note: within this loop
32 | for(int j = 0; j < 3; j++) {
| ~~^~~