/*
* Author: xynex
* Created: 18.12.2021 15:50
* Why am I so stupid? :c
* Slishkom slab
*/
#include <bits/stdc++.h>
// #pragma GCC optimize("inline")
// #pragma GCC optimize("-fgcse,-fgcse-lm")
// #pragma GCC optimize("-ftree-pre,-ftree-vrp")
// #pragma GCC optimize("-ffast-math")
// #pragma GCC optimize("-fipa-sra")
// #pragma GCC optimize("-fpeephole2")
// #pragma GCC optimize("-fsched-spec")
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("unroll-loops")
using namespace std;
#define ll long long
#define dl double long
#define ull unsigned long long
#define pr pair
#define vt vector
#define ff first
#define ss second
#define mp make_pair
#define sz(a) (int)a.size()
#define pb push_back
#define pf push_front
#define popB pop_back
#define popF pop_front
#define bit_count __builtin_popcount
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed << setprecision(x)
template<typename T> T get_rand(T l, T r) {
random_device rd;
mt19937 gen(rd());
return uniform_int_distribution<T>(l, r)(gen);
}
template<typename T> T lcm(T a, T b) { return a * (b / __gcd(a, b)); }
template<class A> void read(vt<A>& v);
template<class A, size_t S> void read(array<A, S>& a);
template<class T> void read(T& x) { cin >> x; }
void read(double& d) { string t; read(t); d = stod(t); }
void read(long double& d) { string t; read(t); d = stold(t); }
template<class H, class... T> void read(H& h, T&... t) { read(h); read(t...); }
template<class A> void read(vt<A>& x) { for (auto& a : x) read(a); }
template<class A, size_t S> void read(array<A, S>& x) { for (auto& a : x) read(a); }
string to_string(char c) { return string(1, c); }
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char* s) { return string(s); }
string to_string(string s) { return s; }
string to_string(vt<bool> v) { string res; for (int i = 0; i < sz(v); ++i) res += char('0' + v[i]); return res; }
template<size_t S> string to_string(bitset<S> b) { string res; for (int i = 0; i < S; ++i) res += char('0' + b[i]); return res; }
template<class T> string to_string(T v) { bool f = 1; string res; for (auto x : v) { if (!f) res += ' '; f = 0; res += to_string(x); } return res; }
template<class A> void write(A x) { cout << to_string(x); }
template<class H, class... T> void write(const H& h, const T&... t) { write(h); write(t...); }
void print() { write("\n"); }
template<class H, class... T> void print(const H& h, const T&... t) { write(h); if (sizeof...(t)) write(' '); print(t...); }
void freop(string s) {
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
const int MOD = 1e9 + 7;
const int N = 3e6 + 5;
const ll INF = 9e18;
const int M = 3e3 + 5;
const dl pi = acos(-1);
const dl eps = 1e-12;
const int sq = 700;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
/* ll vs int*/
void precalc() {
}
ll cnt[N];
ll dp[N];
int n, m, q;
vt<ll> del;
struct el {
int x, y, x1, y1;
} a[N];
ll get() {
for(int i = 1; i <= m; ++i) {
ll x = a[i].x, y = a[i].y, x1 = a[i].x1, y1 = a[i].y1;
for(int j = 0; j < q; ++j) {
ll cur = del[j];
ll X = x1 / (cur * 2) * cur;
X += min(cur, x1 % (cur * 2));
ll XX = (x - 1) / (cur * 2) * cur;
XX += min(cur, (x - 1) % (cur * 2));
X -= XX;
ll Y = y1 / (cur * 2) * cur;
Y += min(cur, y1 % (cur * 2));
ll YY = (y - 1) / (cur * 2) * cur;
YY += min(cur, (y - 1) % (cur * 2));
Y -= YY;
ll X1 = (x1 - x + 1) - X;
ll Y1 = (y1 - y + 1) - Y;
dp[j] -= X * Y + X1 * Y1;
dp[j] += X * Y1 + X1 * Y;
}
}
ll ans = INF;
for(int i = 0; i < q; ++i) {
ans = min(ans, min(dp[i], 1ll * n * n - dp[i]));
}
return ans;
}
ll get1() {
}
void solve() {
read(n, m);
for(int i = 1; i < n; ++i){
if(n % i) continue;
del.pb(i);
}
q = sz(del);
for(int i = 0; i < q; ++i) {
dp[i] = 1ll * n * n - 1ll * n * n / (del[i] * del[i]) / 2 * (del[i] * del[i]);
// print(dp[i]);
}
for(int i = 1; i <= m; ++i) read(a[i].x, a[i].y, a[i].x1, a[i].y1);
ll ans = get();
/* for(int i = 0; i < q; ++i) {
dp[i] = 1ll * n * n - dp[i];
}
ans = min(ans, get1());*/
print(ans);
}
int main() {
//freop("");
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
//read(t);
precalc();
for (int i = 1; i <= t; ++i) {
//write("Case #" + to_string(i) + ": ");
solve();
}
return 0;
}
/*
* Author: xynex
* Created: 18.12.2021 15:50
* Why am I so stupid? :c
* Slishkom slab
*/
#include <bits/stdc++.h>
// #pragma GCC optimize("inline")
// #pragma GCC optimize("-fgcse,-fgcse-lm")
// #pragma GCC optimize("-ftree-pre,-ftree-vrp")
// #pragma GCC optimize("-ffast-math")
// #pragma GCC optimize("-fipa-sra")
// #pragma GCC optimize("-fpeephole2")
// #pragma GCC optimize("-fsched-spec")
// #pragma GCC optimize("Ofast,no-stack-protector")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("unroll-loops")
using namespace std;
#define ll long long
#define dl double long
#define ull unsigned long long
#define pr pair
#define vt vector
#define ff first
#define ss second
#define mp make_pair
#define sz(a) (int)a.size()
#define pb push_back
#define pf push_front
#define popB pop_back
#define popF pop_front
#define bit_count __builtin_popcount
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed << setprecision(x)
template<typename T> T get_rand(T l, T r) {
random_device rd;
mt19937 gen(rd());
return uniform_int_distribution<T>(l, r)(gen);
}
template<typename T> T lcm(T a, T b) { return a * (b / __gcd(a, b)); }
template<class A> void read(vt<A>& v);
template<class A, size_t S> void read(array<A, S>& a);
template<class T> void read(T& x) { cin >> x; }
void read(double& d) { string t; read(t); d = stod(t); }
void read(long double& d) { string t; read(t); d = stold(t); }
template<class H, class... T> void read(H& h, T&... t) { read(h); read(t...); }
template<class A> void read(vt<A>& x) { for (auto& a : x) read(a); }
template<class A, size_t S> void read(array<A, S>& x) { for (auto& a : x) read(a); }
string to_string(char c) { return string(1, c); }
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char* s) { return string(s); }
string to_string(string s) { return s; }
string to_string(vt<bool> v) { string res; for (int i = 0; i < sz(v); ++i) res += char('0' + v[i]); return res; }
template<size_t S> string to_string(bitset<S> b) { string res; for (int i = 0; i < S; ++i) res += char('0' + b[i]); return res; }
template<class T> string to_string(T v) { bool f = 1; string res; for (auto x : v) { if (!f) res += ' '; f = 0; res += to_string(x); } return res; }
template<class A> void write(A x) { cout << to_string(x); }
template<class H, class... T> void write(const H& h, const T&... t) { write(h); write(t...); }
void print() { write("\n"); }
template<class H, class... T> void print(const H& h, const T&... t) { write(h); if (sizeof...(t)) write(' '); print(t...); }
void freop(string s) {
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
const int MOD = 1e9 + 7;
const int N = 3e6 + 5;
const ll INF = 9e18;
const int M = 3e3 + 5;
const dl pi = acos(-1);
const dl eps = 1e-12;
const int sq = 700;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
/* ll vs int*/
void precalc() {
}
ll cnt[N];
ll dp[N];
int n, m, q;
vt<ll> del;
struct el {
int x, y, x1, y1;
} a[N];
ll get() {
for(int i = 1; i <= m; ++i) {
ll x = a[i].x, y = a[i].y, x1 = a[i].x1, y1 = a[i].y1;
for(int j = 0; j < q; ++j) {
ll cur = del[j];
ll X = x1 / (cur * 2) * cur;
X += min(cur, x1 % (cur * 2));
ll XX = (x - 1) / (cur * 2) * cur;
XX += min(cur, (x - 1) % (cur * 2));
X -= XX;
ll Y = y1 / (cur * 2) * cur;
Y += min(cur, y1 % (cur * 2));
ll YY = (y - 1) / (cur * 2) * cur;
YY += min(cur, (y - 1) % (cur * 2));
Y -= YY;
ll X1 = (x1 - x + 1) - X;
ll Y1 = (y1 - y + 1) - Y;
dp[j] -= X * Y + X1 * Y1;
dp[j] += X * Y1 + X1 * Y;
}
}
ll ans = INF;
for(int i = 0; i < q; ++i) {
ans = min(ans, min(dp[i], 1ll * n * n - dp[i]));
}
return ans;
}
ll get1() {
}
void solve() {
read(n, m);
for(int i = 1; i < n; ++i){
if(n % i) continue;
del.pb(i);
}
q = sz(del);
for(int i = 0; i < q; ++i) {
dp[i] = 1ll * n * n - 1ll * n * n / (del[i] * del[i]) / 2 * (del[i] * del[i]);
// print(dp[i]);
}
for(int i = 1; i <= m; ++i) read(a[i].x, a[i].y, a[i].x1, a[i].y1);
ll ans = get();
/* for(int i = 0; i < q; ++i) {
dp[i] = 1ll * n * n - dp[i];
}
ans = min(ans, get1());*/
print(ans);
}
int main() {
//freop("");
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
//read(t);
precalc();
for (int i = 1; i <= t; ++i) {
//write("Case #" + to_string(i) + ": ");
solve();
}
return 0;
}
Compilation message
chessboard.cpp: In function 'long long int get1()':
chessboard.cpp:129:1: warning: no return statement in function returning non-void [-Wreturn-type]
129 | }
| ^
chessboard.cpp: At global scope:
chessboard.cpp:204:24: error: redefinition of 'template<class T> T get_rand(T, T)'
204 | template<typename T> T get_rand(T l, T r) {
| ^~~~~~~~
chessboard.cpp:41:24: note: 'template<class T> T get_rand(T, T)' previously declared here
41 | template<typename T> T get_rand(T l, T r) {
| ^~~~~~~~
chessboard.cpp:210:24: error: redefinition of 'template<class T> T lcm(T, T)'
210 | template<typename T> T lcm(T a, T b) { return a * (b / __gcd(a, b)); }
| ^~~
chessboard.cpp:47:24: note: 'template<class T> T lcm(T, T)' previously declared here
47 | template<typename T> T lcm(T a, T b) { return a * (b / __gcd(a, b)); }
| ^~~
chessboard.cpp:214:24: error: redefinition of 'template<class T> void read(T&)'
214 | template<class T> void read(T& x) { cin >> x; }
| ^~~~
chessboard.cpp:51:24: note: 'template<class T> void read(T&)' previously declared here
51 | template<class T> void read(T& x) { cin >> x; }
| ^~~~
chessboard.cpp:215:6: error: redefinition of 'void read(double&)'
215 | void read(double& d) { string t; read(t); d = stod(t); }
| ^~~~
chessboard.cpp:52:6: note: 'void read(double&)' previously defined here
52 | void read(double& d) { string t; read(t); d = stod(t); }
| ^~~~
chessboard.cpp:216:6: error: redefinition of 'void read(long double&)'
216 | void read(long double& d) { string t; read(t); d = stold(t); }
| ^~~~
chessboard.cpp:53:6: note: 'void read(long double&)' previously defined here
53 | void read(long double& d) { string t; read(t); d = stold(t); }
| ^~~~
chessboard.cpp:217:36: error: redefinition of 'template<class H, class ... T> void read(H&, T& ...)'
217 | template<class H, class... T> void read(H& h, T&... t) { read(h); read(t...); }
| ^~~~
chessboard.cpp:54:36: note: 'template<class H, class ... T> void read(H&, T& ...)' previously declared here
54 | template<class H, class... T> void read(H& h, T&... t) { read(h); read(t...); }
| ^~~~
chessboard.cpp:218:24: error: redefinition of 'template<class A> void read(std::vector<_Tp>&)'
218 | template<class A> void read(vt<A>& x) { for (auto& a : x) read(a); }
| ^~~~
chessboard.cpp:55:24: note: 'template<class A> void read(std::vector<_Tp>&)' previously declared here
55 | template<class A> void read(vt<A>& x) { for (auto& a : x) read(a); }
| ^~~~
chessboard.cpp:219:34: error: redefinition of 'template<class A, long unsigned int S> void read(std::array<_Tp, _Nm>&)'
219 | template<class A, size_t S> void read(array<A, S>& x) { for (auto& a : x) read(a); }
| ^~~~
chessboard.cpp:56:34: note: 'template<class A, long unsigned int S> void read(std::array<_Tp, _Nm>&)' previously declared here
56 | template<class A, size_t S> void read(array<A, S>& x) { for (auto& a : x) read(a); }
| ^~~~
chessboard.cpp:221:8: error: redefinition of 'std::string to_string(char)'
221 | string to_string(char c) { return string(1, c); }
| ^~~~~~~~~
chessboard.cpp:58:8: note: 'std::string to_string(char)' previously defined here
58 | string to_string(char c) { return string(1, c); }
| ^~~~~~~~~
chessboard.cpp:222:8: error: redefinition of 'std::string to_string(bool)'
222 | string to_string(bool b) { return b ? "true" : "false"; }
| ^~~~~~~~~
chessboard.cpp:59:8: note: 'std::string to_string(bool)' previously defined here
59 | string to_string(bool b) { return b ? "true" : "false"; }
| ^~~~~~~~~
chessboard.cpp:223:8: error: redefinition of 'std::string to_string(const char*)'
223 | string to_string(const char* s) { return string(s); }
| ^~~~~~~~~
chessboard.cpp:60:8: note: 'std::string to_string(const char*)' previously defined here
60 | string to_string(const char* s) { return string(s); }
| ^~~~~~~~~
chessboard.cpp:224:8: error: redefinition of 'std::string to_string(std::string)'
224 | string to_string(string s) { return s; }
| ^~~~~~~~~
chessboard.cpp:61:8: note: 'std::string to_string(std::string)' previously defined here
61 | string to_string(string s) { return s; }
| ^~~~~~~~~
chessboard.cpp:225:8: error: redefinition of 'std::string to_string(std::vector<bool>)'
225 | string to_string(vt<bool> v) { string res; for (int i = 0; i < sz(v); ++i) res += char('0' + v[i]); return res; }
| ^~~~~~~~~
chessboard.cpp:62:8: note: 'std::string to_string(std::vector<bool>)' previously defined here
62 | string to_string(vt<bool> v) { string res; for (int i = 0; i < sz(v); ++i) res += char('0' + v[i]); return res; }
| ^~~~~~~~~
chessboard.cpp:226:27: error: redefinition of 'template<long unsigned int S> std::string to_string(std::bitset<_Nb>)'
226 | template<size_t S> string to_string(bitset<S> b) { string res; for (int i = 0; i < S; ++i) res += char('0' + b[i]); return res; }
| ^~~~~~~~~
chessboard.cpp:63:27: note: 'template<long unsigned int S> std::string to_string(std::bitset<_Nb>)' previously declared here
63 | template<size_t S> string to_string(bitset<S> b) { string res; for (int i = 0; i < S; ++i) res += char('0' + b[i]); return res; }
| ^~~~~~~~~
chessboard.cpp:227:26: error: redefinition of 'template<class T> std::string to_string(T)'
227 | template<class T> string to_string(T v) { bool f = 1; string res; for (auto x : v) { if (!f) res += ' '; f = 0; res += to_string(x); } return res; }
| ^~~~~~~~~
chessboard.cpp:64:26: note: 'template<class T> std::string to_string(T)' previously declared here
64 | template<class T> string to_string(T v) { bool f = 1; string res; for (auto x : v) { if (!f) res += ' '; f = 0; res += to_string(x); } return res; }
| ^~~~~~~~~
chessboard.cpp:229:24: error: redefinition of 'template<class A> void write(A)'
229 | template<class A> void write(A x) { cout << to_string(x); }
| ^~~~~
chessboard.cpp:66:24: note: 'template<class A> void write(A)' previously declared here
66 | template<class A> void write(A x) { cout << to_string(x); }
| ^~~~~
chessboard.cpp:230:36: error: redefinition of 'template<class H, class ... T> void write(const H&, const T& ...)'
230 | template<class H, class... T> void write(const H& h, const T&... t) { write(h); write(t...); }
| ^~~~~
chessboard.cpp:67:36: note: 'template<class H, class ... T> void write(const H&, const T& ...)' previously declared here
67 | template<class H, class... T> void write(const H& h, const T&... t) { write(h); write(t...); }
| ^~~~~
chessboard.cpp:232:6: error: redefinition of 'void print()'
232 | void print() { write("\n"); }
| ^~~~~
chessboard.cpp:69:6: note: 'void print()' previously defined here
69 | void print() { write("\n"); }
| ^~~~~
chessboard.cpp:233:36: error: redefinition of 'template<class H, class ... T> void print(const H&, const T& ...)'
233 | template<class H, class... T> void print(const H& h, const T&... t) { write(h); if (sizeof...(t)) write(' '); print(t...); }
| ^~~~~
chessboard.cpp:70:36: note: 'template<class H, class ... T> void print(const H&, const T& ...)' previously declared here
70 | template<class H, class... T> void print(const H& h, const T&... t) { write(h); if (sizeof...(t)) write(' '); print(t...); }
| ^~~~~
chessboard.cpp:235:6: error: redefinition of 'void freop(std::string)'
235 | void freop(string s) {
| ^~~~~
chessboard.cpp:72:6: note: 'void freop(std::string)' previously defined here
72 | void freop(string s) {
| ^~~~~
chessboard.cpp:240:11: error: redefinition of 'const int MOD'
240 | const int MOD = 1e9 + 7;
| ^~~
chessboard.cpp:77:11: note: 'const int MOD' previously defined here
77 | const int MOD = 1e9 + 7;
| ^~~
chessboard.cpp:241:11: error: redefinition of 'const int N'
241 | const int N = 3e6 + 5;
| ^
chessboard.cpp:78:11: note: 'const int N' previously defined here
78 | const int N = 3e6 + 5;
| ^
chessboard.cpp:242:10: error: redefinition of 'const long long int INF'
242 | const ll INF = 9e18;
| ^~~
chessboard.cpp:79:10: note: 'const long long int INF' previously defined here
79 | const ll INF = 9e18;
| ^~~
chessboard.cpp:243:11: error: redefinition of 'const int M'
243 | const int M = 3e3 + 5;
| ^
chessboard.cpp:80:11: note: 'const int M' previously defined here
80 | const int M = 3e3 + 5;
| ^
chessboard.cpp:244:10: error: redefinition of 'const long double pi'
244 | const dl pi = acos(-1);
| ^~
chessboard.cpp:81:10: note: 'const long double pi' previously defined here
81 | const dl pi = acos(-1);
| ^~
chessboard.cpp:245:10: error: redefinition of 'const long double eps'
245 | const dl eps = 1e-12;
| ^~~
chessboard.cpp:82:10: note: 'const long double eps' previously defined here
82 | const dl eps = 1e-12;
| ^~~
chessboard.cpp:246:11: error: redefinition of 'const int sq'
246 | const int sq = 700;
| ^~
chessboard.cpp:83:11: note: 'const int sq' previously defined here
83 | const int sq = 700;
| ^~
chessboard.cpp:248:5: error: redefinition of 'int dx []'
248 | int dx[] = {-1, 0, 1, 0};
| ^~
chessboard.cpp:85:5: note: 'int dx [4]' previously defined here
85 | int dx[] = {-1, 0, 1, 0};
| ^~
chessboard.cpp:249:5: error: redefinition of 'int dy []'
249 | int dy[] = {0, -1, 0, 1};
| ^~
chessboard.cpp:86:5: note: 'int dy [4]' previously defined here
86 | int dy[] = {0, -1, 0, 1};
| ^~
chessboard.cpp:252:6: error: redefinition of 'void precalc()'
252 | void precalc() {
| ^~~~~~~
chessboard.cpp:89:6: note: 'void precalc()' previously defined here
89 | void precalc() {
| ^~~~~~~
chessboard.cpp:256:4: error: redefinition of 'long long int cnt [3000005]'
256 | ll cnt[N];
| ^~~
chessboard.cpp:93:4: note: 'long long int cnt [3000005]' previously declared here
93 | ll cnt[N];
| ^~~
chessboard.cpp:257:4: error: redefinition of 'long long int dp [3000005]'
257 | ll dp[N];
| ^~
chessboard.cpp:94:4: note: 'long long int dp [3000005]' previously declared here
94 | ll dp[N];
| ^~
chessboard.cpp:258:5: error: redefinition of 'int n'
258 | int n, m, q;
| ^
chessboard.cpp:95:5: note: 'int n' previously declared here
95 | int n, m, q;
| ^
chessboard.cpp:258:8: error: redefinition of 'int m'
258 | int n, m, q;
| ^
chessboard.cpp:95:8: note: 'int m' previously declared here
95 | int n, m, q;
| ^
chessboard.cpp:258:11: error: redefinition of 'int q'
258 | int n, m, q;
| ^
chessboard.cpp:95:11: note: 'int q' previously declared here
95 | int n, m, q;
| ^
chessboard.cpp:259:8: error: redefinition of 'std::vector<long long int> del'
259 | vt<ll> del;
| ^~~
chessboard.cpp:96:8: note: 'std::vector<long long int> del' previously declared here
96 | vt<ll> del;
| ^~~
chessboard.cpp:260:8: error: redefinition of 'struct el'
260 | struct el {
| ^~
chessboard.cpp:97:8: note: previous definition of 'struct el'
97 | struct el {
| ^~
chessboard.cpp:262:3: error: conflicting declaration 'int a [3000005]'
262 | } a[N];
| ^
chessboard.cpp:99:3: note: previous declaration as 'el a [3000005]'
99 | } a[N];
| ^
chessboard.cpp:263:4: error: redefinition of 'long long int get()'
263 | ll get() {
| ^~~
chessboard.cpp:100:4: note: 'long long int get()' previously defined here
100 | ll get() {
| ^~~
chessboard.cpp:290:4: error: redefinition of 'long long int get1()'
290 | ll get1() {
| ^~~~
chessboard.cpp:127:4: note: 'long long int get1()' previously defined here
127 | ll get1() {
| ^~~~
chessboard.cpp: In function 'long long int get1()':
chessboard.cpp:292:1: warning: no return statement in function returning non-void [-Wreturn-type]
292 | }
| ^
chessboard.cpp: At global scope:
chessboard.cpp:293:6: error: redefinition of 'void solve()'
293 | void solve() {
| ^~~~~
chessboard.cpp:130:6: note: 'void solve()' previously defined here
130 | void solve() {
| ^~~~~
chessboard.cpp:313:5: error: redefinition of 'int main()'
313 | int main() {
| ^~~~
chessboard.cpp:150:5: note: 'int main()' previously defined here
150 | int main() {
| ^~~~
chessboard.cpp: In function 'void freop(std::string)':
chessboard.cpp:73:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
73 | freopen((s + ".in").c_str(), "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
chessboard.cpp:74:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
74 | freopen((s + ".out").c_str(), "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
chessboard.cpp: In function 'void freop(std::string)':
chessboard.cpp:236:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
236 | freopen((s + ".in").c_str(), "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
chessboard.cpp:237:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
237 | freopen((s + ".out").c_str(), "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~