criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
#include<cassert>
using namespace std;
#include<atcoder/all>
using namespace atcoder;


#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 998244353;
const ll MAX = 4000001;
const long double eps = 1E-14;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

ll gcd(ll a, ll b) {
	if (b == 0) { return a; }
	if (a < b) { return gcd(b, a); }
	return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

using mint = modint998244353;

typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;

typedef vector<mint> vmint;
typedef vector<vector<mint>> vvmint;
typedef vector<vector<vector<mint>>> vvvmint;

/////////////////////////////////////

int main() {
	ll N, M;
	cin >> N >> M;
	vector<string>S(M);
	rep(i, M)cin >> S[i];

	mf_graph<ll> g(N * M + 2);
	ll s = N * M;
	ll t = N * M + 1;

	auto v = [&](ll i, ll j) {return i * M + j; };

	rep(i, N)rep(j, M) {
		
		if((i+j)%2==0){
			g.add_edge(s, v(i, j), 1);

			if (i < N-1 && S[i][j] == '.' && S[i + 1][j] == '.') {g.add_edge(v(i, j), v(i + 1, j), 1); }
			if (i > 0 && S[i][j] == '.' && S[i - 1][j] == '.') {g.add_edge(v(i, j), v(i - 1, j), 1); }
			if (j < M-1 && S[i][j] == '.' && S[i][j + 1] == '.') {g.add_edge(v(i, j), v(i, j + 1), 1); }
			if (j > 0 && S[i][j] == '.' && S[i][j - 1] == '.') {g.add_edge(v(i, j), v(i, j - 1), 1); }

		}
		else {
			g.add_edge(v(i, j), t, 1);
		}
	}

	ll ans = g.flow(s, t);
	cout << ans << endl;
	
	auto ed = g.edges();

	vector<string> grid = S;
	for (auto e : ed) {
		if (e.flow == 1) {
			ll x = e.from;
			ll y = e.to;
			if (x == s || y == t) { continue; }

			if (x > y) { swap(x, y); }
			if (x + 1 == y) {
				grid[x / M][x % M] = '>';
				grid[y / M][y % M] = '<';
			}
			if (x + M == y) {
				grid[x / M][x % M] = 'v';
				grid[y / M][y % M] = '^';
			}
		}
	}
	cout << ans << endl;
	rep(i, N)cout << grid[i] << endl;
}


Compiler output:
a.cc:16:9: fatal error: atcoder/all: No such file or directory
   16 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <iomanip>
#include <cassert>
#include <atcoder/maxflow>

using namespace std;
using namespace atcoder;
typedef long long ll;
int N, M;

pair<int, int> id2p(int i)
{
   i -= 1;
   pair<int, int> ret;
   ret.first = i / M;
   ret.second = i % M;
   return ret;
}

int main()
{
   cin >> N >> M;
   mf_graph<int> graph(N * M + 2);
   vector<string> S(N);
   int dirX[] = {0, 0, 1, -1};
   int dirY[] = {1, -1, 0, 0};
   for (int i = 0; i < N; i++)
   {
      cin >> S[i];
   }
   for (int i = 0; i < N; i++)
   {
      for (int j = 0; j < M; j++)
      {
         int nodeID = i * M + j + 1;
         if (S[i][j] == '#')
            continue;
         if ((i + j) % 2 == 0)
         {
            graph.add_edge(0, nodeID, 1);
            for (int k = 0; k < 4; k++)
            {
               int ii = i + dirX[k];
               int jj = j + dirY[k];
               if (0 <= ii && ii < N && 0 <= jj && jj < M && S[ii][jj] == '.')
               {
                  int nodeID2 = ii * M + jj + 1;
                  graph.add_edge(nodeID, nodeID2, 1);
               }
            }
         }
         else
         {
            graph.add_edge(nodeID, N * M + 1, 1);
         }
      }
   }
   cout << graph.flow(0, N * M + 1) << endl;
   auto edges = graph.edges();
   for (auto edge : edges)
   {
      if (edge.flow == 1 && edge.from != 0 && edge.to != N * M + 1)
      {
         pair<int, int> p1 = id2p(edge.from);
         pair<int, int> p2 = id2p(edge.to);
         if (p1 > p2)
            swap(p1, p2);
         if (p1.first == p2.first)
         {
            S[p1.first][p1.second] = '>';
            S[p2.first][p2.second] = '<';
         }
         else
         {
            S[p1.first][p1.second] = 'v';
            S[p2.first][p2.second] = '^';
         }
      }
   }
   for (int i = 0; i < N; i++)
   {
      cout << S[i] << endl;
   }
   return 0;
}


Compiler output:
a.cc:22:10: fatal error: atcoder/maxflow: No such file or directory
   22 | #include <atcoder/maxflow>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>
#include <random>

#include <atcoder/all>

#define FOR_LT(i, beg, end) for (int i = (int)(beg); i < (int)(end); i++)
#define FOR_LE(i, beg, end) for (int i = (int)(beg); i <= (int)(end); i++)
#define FOR_DW(i, beg, end) for (int i = (int)(beg); (int)(end) <= i; i--)
#define REP(n)              for (int repeat_index = 0; repeat_index < (int)n; repeat_index++)

using namespace std;

int bmap[101][101] = {};

int idx(int i, int j, int n, int m)
{
	(void)m;
	return j * n + i;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(20);

	int n, m; cin >> n >> m;

	atcoder::mf_graph<int> mfg(n * m + 2);
	FOR_LT(i, 0, n) {
		string s; cin >> s;
		FOR_LT(j, 0, m) {
			if (s[j] == '#') bmap[i][j] = 1;
		}
	}

	FOR_LT(i, 0, n) {
		FOR_LT(j, 0, m) {
			if (bmap[i][j] == 1) continue;
			if (i != n - 1 && bmap[i + 1][j] != 1) {
				int idx1 = idx(i, j, n, m);
				int idx2 = idx(i + 1, j, n, m);
				if (idx2 & 1) swap(idx1, idx2);
				mfg.add_edge(idx1, idx2, 1);
			}
			if (j != m - 1 && bmap[i][j + 1] != 1) {
				int idx1 = idx(i, j, n, m);
				int idx2 = idx(i, j + 1, n, m);
				if (idx2 & 1) swap(idx1, idx2);
				mfg.add_edge(idx1, idx2, 1);
			}
		}
	}

	FOR_LT(i, 0, n) {
		FOR_LT(j, 0, m) {
			if ((i + j) & 1) mfg.add_edge(n * m, idx(i, j, n, m), 1);
			else mfg.add_edge(idx(i, j, n, m), n * m + 1, 1);
		}
	}
	mfg.flow(n*m, n*m + 1);

	auto edges = mfg.edges();
	for (auto& edge : edges) {
		int idx1 = edge.from;
		int idx2 = edge.to;
		if (edge.flow == 0) continue;
		if (idx1 > idx2) swap(idx1, idx2);
		if (idx2 == n * m) continue;
		if (idx2 == n * m + 1) continue;

		int i1 = idx1 % n;
		int j1 = idx1 / n;
		int i2 = idx2 % n;
		int j2 = idx2 / n;
		assert(i1 == i2 || j1 == j2);
		assert(!(i1 == i2 && j1 == j2));
		if (i1 != i2) {
			bmap[i1][j1] = 2;
			bmap[i2][j2] = 3;
		}
		if (j1 != j2) {
			bmap[i1][j1] = 4;
			bmap[i2][j2] = 5;
		}
	}
	FOR_LT(i, 0, n) {
		FOR_LT(j, 0, m) {
			switch (bmap[i][j]) {
			case 0:
				cout << "."; break;
			case 1:
				cout << "#"; break;
			case 2:
				cout << "v"; break;
			case 3:
				cout << "^"; break;
			case 4:
				cout << ">"; break;
			case 5:
				cout << "<"; break;
			}
		}
		cout << endl;
	}

	return 0;
}

Compiler output:
a.cc:28:10: fatal error: atcoder/all: No such file or directory
   28 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/maxflow>
#include <iostream>
using namespace std; using namespace atcoder;

int main() {
  int n,m; cin>>n>>m;
  mf_graph<int> gr(n*n+2);
  
  string s[n];
  for(int i=0;i<n;i++) cin>>s[i];
  
  for(int i=0;i<n;i++) {
    for(int j=0;j<m-1;j++) {
      if (s[i][j] == '#' || s[i][j+1] == '#') continue;
      if ((i+j)%2 == 0) gr.add_edge(i*n+j,i*n+j+1,1);
      else gr.add_edge(i*n+j+1,i*n+j,1);
    }
  }
  
  for(int i=0;i<n-1;i++) {
    for(int j=0;j<m;j++) {
      if (s[i][j] == '#' || s[i+1][j] == '#') continue;
      if ((i+j)%2 == 0) gr.add_edge(i*n+j,(i+1)*n+j,1);
      else gr.add_edge((i+1)*n+j,i*n+j,1);
    }
  }
  
  for(int i=0;i<n;i++) {
    for(int j=0;j<m;j++) {
      if ((i+j)%2 == 0) gr.add_edge(n*n, i*n+j, 1);
      else gr.add_edge(i*n+j, n*n+1, 1);
    }
  }
  
  gr.flow(n*n, n*n+1);
  
  auto edges = gr.edges();
  for(auto e : edges) {
    if (e.from == n*n || e.to == n*n+1 || e.flow == 0) continue;
    int x0 = e.from / n;
    int y0 = e.from % n;
    int x1 = e.to / n;
    int y1 = e.to % n;
    
    // 横
    if (x0 == x1) {
      s[x0][y0] = '<';
      s[x1][y1] = '>';
    } else {
      s[x0][y0] = '^';
      s[x1][y1] = 'v';
    }
  }
  
  for(int i=0;i<n;i++) {
    cout<<s[i]<<endl;
  }
}

Compiler output:
a.cc:1:10: fatal error: atcoder/maxflow: No such file or directory
    1 | #include <atcoder/maxflow>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

// execute g++ main.cpp -std=c++14 -I C:\Users\naoya\Desktop\code\Atcoder
#include<bits/stdc++.h>
#include<atcoder/all>
typedef long long ll;
typedef long double ld;
using namespace std;
using namespace atcoder;

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

template<class T>inline bool chmax(T &a, T b) {if(a < b) {a = b;return true;}return false;}
template<class T>inline bool chmin(T &a, T b) {if(a > b) {a = b;return true;}return false;}


char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(){
    int n, m; cin >> n >> m;
    vector<string> lis(n);
    mf_graph<int> g(n * m + 2);
    int s = n * m, t = n * m + 1;
    REP(i, 0, n){
        cin >> lis[i];
    }
    REP(i, 0, n){
        REP(l, 0, m){
            if(lis[i][l] == '.'){
                int v = i * m + l;
                if((i + l) % 2 == 0){
                    g.add_edge(s, v, 1);
                }else{
                    g.add_edge(v, t, 1);
                }
            }
        }
    }

    REP(i, 0, n){
        REP(l, 0, m){
            if((i + l) % 2  == 0 && lis[i][l] == '.'){
                int v = i * m + l;
                REP(k, 0, 4){
                    int x = i + dx[k], y = l + dy[k];
                    if(x >= 0 && x < n && y >= 0 && y < m && lis[x][y] == '.'){
                        g.add_edge(v, x * m + y, 1);
                    }
                }
            }
        }
    }

    cout << g.flow(s, t) << endl;

    auto edges = g.edges();
    for(auto e : edges){
        if(e.from == s || e.to == t || e.flow == 0) continue;
        int i0 = e.from / m, l0 = e.from % m;
        int i1 = e.to / m, l1 = e.to % m;
        if (i0 == i1 + 1) {
            lis[i1][l1] = 'v';
            lis[i0][l0] = '^';
        } else if (l0 == l1 + 1) {
            lis[i1][l1] = '>';
            lis[i0][l0] = '<';
        } else if (i0 == i1 - 1) {
            lis[i0][l0] = 'v';
            lis[i1][l1] = '^';
        } else {
            lis[i0][l0] = '>';
            lis[i1][l1] = '<';
        }
    }

    REP(i, 0, n){
        cout << lis[i] << endl;
    }
}

Compiler output:
a.cc:3:9: fatal error: atcoder/all: No such file or directory
    3 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/maxflow> 
#include <bits/stdc++.h>
using namespace atcoder;
using namespace std;

int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	int s = n*m, t = n*m+1;
	char grid[n+5][m+5];
	mf_graph<int> graph(n*m+2);
	for (int i = 0; i < n; ++i) scanf("%s", grid[i]);
	for (int i = 0, v = 0; i < n; ++i) {
		for (int j = 0; j < m; ++j, ++v) {
			if (grid[i][j] != '#') {
				if ((i+j)&1) graph.add_edge(v, t, 1);
				else {
					graph.add_edge(s, v, 1);
					if (i && grid[i-1][j] == '.') graph.add_edge(v, v-m, 1);
					if (i+1<n && grid[i+1][j] == '.') graph.add_edge(v, v+m, 1);
					if (j && grid[i][j-1] == '.') graph.add_edge(v, v-1, 1);
					if (j+1<m && grid[i][j+1] == '.') graph.add_edge(v, v+1, 1);
				}
			}
		}
	}
	printf("%d\n", graph.flow(s, t));
	auto edges = graph.edges();
	for (auto e : edges) {
		if (e.from != s && e.to != t && e.flow) {
			int i = e.from/m, j = e.from%m, i1 = e.to/m, j1 = e.to%m;
			if (i+1 == i1) {
				grid[i][j] = 'v';
				grid[i1][j1] = '^';
			}
			else if (i-1 == i1) {
				grid[i][j] = '^';
				grid[i1][j1] = 'v';
			}
			else if (j+1 == j1) {
				grid[i][j] = '>';
				grid[i1][j1] = '<';
			}
			else {
				grid[i][j] = '<';
				grid[i1][j1] = '>';
			}
		}
	}
	for (int i = 0; i < n; ++i) printf("%s\n", grid[i]);
}


Compiler output:
a.cc:1:10: fatal error: atcoder/maxflow: No such file or directory
    1 | #include <atcoder/maxflow>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include"bits/stdc++.h"
#include<atcoder/maxflow.hpp>
using namespace atcoder;
using namespace std;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;
using pll = pair<ll, ll>;
using tp3 = tuple<ll, ll, ll>;
constexpr int INF = 1 << 28;
constexpr ll INFL = 1ll << 60;
constexpr int dh[4] = { 0,1,0,-1 };
constexpr int dw[4] = { -1,0,1,0 };
bool isin(const int H, const int W, const int h, const int w) {
    return 0 <= h && h < H && 0 <= w && w < W;
}
// ============ template finished ============

using pii = pair<int, int>;

int idx(const int N, const int M, int i, int j) {
    if (i < 0 || N <= i || j < 0 || M <= j)return -1;
    return i * M + j;
}

pii reverse(const int M, int num) {
    int i = num / M;
    int j = num % M;
    return make_pair(i, j);
}

string out(pii p) {
    return "(" + to_string(p.first) + "," + to_string(p.second) + ")";
}

int main()
{
    int N, M;
    cin >> N >> M;
    vector<string> S(N);
    rep(i, N)cin >> S[i];

    const int SIZE = N * M;
    mf_graph<int> graph(SIZE + 2);
    vector<pii> edges;

    auto add_edge = [&](int from, int to) {
        if (from < SIZE) {
            auto[i, j] = reverse(M, from);
            if (S[i][j] == '#')return;
        }
        if (to < SIZE) {
            auto[i, j] = reverse(M, to);
            if (S[i][j] == '#')return;
        }
        graph.add_edge(from, to, 1);
        edges.push_back({ from, to });
    };

    rep(i, N) rep(j, M) {
        bool left = (i + j) % 2 == 0;
        if (left) {
            int now = idx(N, M, i, j);
            add_edge(SIZE, now);

            rep(dir, 4) {
                int opp = idx(N, M, i + dh[dir], j + dw[dir]);
                if (opp != -1) add_edge(now, opp);
            }
        }
        else {
            int now = idx(N, M, i, j);
            add_edge(now, SIZE + 1);
        }
    }
    int flow = graph.flow(SIZE, SIZE + 1);
    cout << flow << endl;

    auto angle = [](pii from, pii to) {
        if (from.first < to.first)return 'v';
        if (from.first > to.first)return '^';
        if (from.second < to.second)return '>';
        if (from.second > to.second)return '<';
        assert(false);
        return 'P';
    };

    auto res = graph.edges();
    for (auto edge : res) {
        if (SIZE <= edge.from || SIZE <= edge.to)continue;
        if (edge.cap != edge.flow)continue;
        auto p1 = reverse(M, edge.from);
        auto p2 = reverse(M, edge.to);
        S[p1.first][p1.second] = angle(p1, p2);
        S[p2.first][p2.second] = angle(p2, p1);
    }
    for (auto row : S)cout << row << endl;
    return 0;
}


Compiler output:
a.cc:2:9: fatal error: atcoder/maxflow.hpp: No such file or directory
    2 | #include<atcoder/maxflow.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/all>
using namespace atcoder;
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define rrep(i, n) for (int i = (int)n-1; i >= 0; --i)
using namespace std;
using ll = long long;
template<typename T>
inline bool chmax(T& a, const T& b) {
    if (a < b){
        a = b;
        return true;
    }
    return false;
}
template<typename T>
inline bool chmin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
/**
 * @brief 多次元 vector の作成
 * @author えびちゃん
 */
namespace detail {
    template<typename T, int N>
    auto make_vec(vector<int>& sizes, T const& x) {
        if constexpr (N == 1) {
            return vector(sizes[0], x);
        } else {
            int size = sizes[N-1];
            sizes.pop_back();
            return vector(size, make_vec<T, N-1>(sizes, x));
        }
    }
}
template<typename T, int N>
auto make_vec(int const(&sizes)[N], T const& x = T()) {
    vector<int> s(N);
    for (int i = 0; i < N; ++i) s[i] = sizes[N-i-1];
    return detail::make_vec<T, N>(s, x);
}
__attribute__((constructor))
void fast_io() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

int main() {
    int n, m;
    cin >> n >> m;
    vector<string> s(n);
    rep(i, n) cin >> s[i];

    int V = n * m + 2;
    int a = n * m, b = a + 1;

    mf_graph<int> g(V);

    rep(i, n) rep(j, m) {
        if ((i + j) % 2 == 0) g.add_edge(a, m * i + j, 1);
        else g.add_edge(m * i + j, b, 1);
    }

    array<int, 4> di = {1, 0, -1, 0}, dj = {0, 1, 0, -1};
    rep(i, n) rep(j, m) {
        if ((i + j) % 2 == 0 && s[i][j] == '.') {
            rep(k, 4) {
                int ni = i + di[k], nj = j + dj[k];
                if (0 <= ni && 0 <= nj && ni < n && nj < m && s[ni][nj] == '.') {
                    g.add_edge(m * i + j, m * ni + nj, 1);
                }
            }
        }
    }

    int ans = g.flow(a, b);
    
    auto es = g.edges();
    for (auto e : es) {
        if (e.flow > 0 && e.from != a && e.to != b) {
            int x = e.from, y = e.to;
            if (x > y) swap(x, y);
            int xi = x / m, xj = x % m;
            int yi = y / m, yj = y % m;
            if (x + 1 == y) {
                s[xi][xj] = '>';
                s[yi][yj] = '<';
            } else {
                s[xi][xj] = 'v';
                s[yi][yj] = '^';
            }
        }
    }

    cout << ans << '\n';
    rep(i, n) cout << s[i] << '\n';
}

Compiler output:
a.cc:1:10: fatal error: atcoder/all: No such file or directory
    1 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
template <class T>
inline bool chmin(T &a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;
using namespace atcoder;


void solve(){
	int n,m;
	cin>>n>>m;
	vector<string>S(n);
	rep(i,n)cin>>S[i];
	mf_graph<int>f(n*m+2);
	int s=n*m,t=n*m+1;
	rep(i,n){
		rep(j,m){
			int id=i*m+j;
			if(S[i][j]=='#')continue;
			if((i+j)%2==0){
				f.add_edge(s,id,1);
			}
			else{
				f.add_edge(id,t,1);
			}
		}
	}
	rep(i,n){
		rep(j,m){
			if((i+j)%2||S[i][j]=='#')continue;
			int id=i*m+j;
			if(i-1>=0&&S[i-1][j]!='#'){
				f.add_edge(id,(i-1)*m+j,1);
			}
			if(j-1>=0&&S[i][j-1]!='#'){
				f.add_edge(id,i*m+(j-1),1);
			}
			if(i+1<n&&S[i+1][j]!='#'){
				f.add_edge(id,(i+1)*m+j,1);
			}
			if(j+1<m&&S[i][j+1]!='#'){
				f.add_edge(id,i*m+(j+1),1);
			}
		}
	}
	cout<<f.flow(s,t)<<"\n";
	vector<vector<char>>ans(n,vector<char>(m,'.'));
	for(auto e:f.edges()){
		int x=e.from,y=e.to;
		if(x>y)swap(x,y);
		if(x==s||x==t||y==s||y==t)continue;
		if(ans[x/m][x%m]!='.'||ans[y/m][y%m]!='.')continue;
		if(y-x==1){
			ans[x/m][x%m]='>';
			ans[y/m][y%m]='<';
		}
		else{
			ans[x/m][x%m]='v';
			ans[y/m][y%m]='^';
		}
	}
	rep(i,n){
		rep(j,m){
			if(S[i][j]=='#')cout<<'#';
			else cout<<ans[i][j];
		}
		cout<<"\n";
	}
}


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/maxflow>
#include <bits/stdc++.h>
 
using namespace std;
using namespace atcoder;

#define S (n * m)
#define T (n * m + 1)
#define E(i, j) ((i) * m + (j))
#define P(e) {(e) / m, (e) % m}

typedef mf_graph<int> G;

int main() {
  int n, m;
  cin >> n >> m;

  vector<string> s(n);
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }

  G g(n * m + 2); // graph-size + S + T
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (s[i][j] != '#') {
        if ((i + j) % 2 == 0) {
          g.add_edge(S, E(i, j), 1);
          if ((i     > 0) && (s[i - 1][j] != '#')) { g.add_edge(E(i, j), E(i - 1, j), 1); }
          if ((i + 1 < n) && (s[i + 1][j] != '#')) { g.add_edge(E(i, j), E(i + 1, j), 1); }
          if ((j     > 0) && (s[i][j - 1] != '#')) { g.add_edge(E(i, j), E(i, j - 1), 1); }
          if ((j + 1 < m) && (s[i][j + 1] != '#')) { g.add_edge(E(i, j), E(i, j + 1), 1); }
        } else {
          g.add_edge(E(i, j), T, 1);
        }
      }
    }
  }
  cout << g.flow(S, T) << endl;

  vector<G::edge> e = g.edges();
  for (unsigned long i = 0UL; i < e.size(); ++i) {
    if ((e[i].flow > 0) && (e[i].from != S) && (e[i].to != T)) {
      pair<int, int> f = P(e[i].from), t = P(e[i].to);
      if (f > t) { swap(f, t); }
      if (f.first + 1 == t.first) {
        s[f.first][f.second] = 'v';
        s[t.first][t.second] = '^';
      } else {
        s[f.first][f.second] = '>';
        s[t.first][t.second] = '<';
      }
    }
  }

  for (int i = 0; i < n; ++i) {
    cout << s[i] << endl;
  }

  return 0;
}


Compiler output:
a.cc:1:10: fatal error: atcoder/maxflow: No such file or directory
    1 | #include <atcoder/maxflow>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/maxflow>

using namespace std;
#ifdef __DEBUG__
    void debug_out() { cerr << endl; } 
    template <typename Head, typename... Tail>
    void debug_out(Head H, Tail... T) {cerr << " " << H; debug_out(T...);}
    #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) 
#endif

int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N,M;
vector<string> S;
inline void input(){
    fast_io();
    cin >> N >> M;
    for (int i = 0; i < N; i++)
    {
        string s; cin >> s;
        S.push_back(s);
    }
}

#define WALL '#'
#define PATH '.'


inline int solve(){
    atcoder::mf_graph<int> MF(N*M+10);
    int source = N*M , sink = N*M+1;
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < M; j++)
        {
            if(S[i][j]==WALL) continue;
            if((i+j)%2==0){
                MF.add_edge(source, i*M+j, 1);
                for (int k = 0; k < 4; k++)
                {
                    int x = i + dx[k];
                    int y = j + dy[k];
                    if(x < 0|| x>=N) continue;
                    if(y < 0|| y>=M) continue;
                    if(S[x][y]==WALL) continue;
                    MF.add_edge(i*M+j, x*M+y, 1);
                }
                
            }
            else{
                MF.add_edge(i*M+j, sink, 1);
            }
        }
    }
    int ans = MF.flow(source, sink);
    vector<string> Fields = S;
    for(auto e:MF.edges()){
        if(e.from != source && e.to != sink && e.flow==1){
            int fi = e.from / M, fj = e.from % M;
            int ti = e.to / M, tj = e.to % M;
            if(fi==ti){
                Fields[fi][min(fj,tj)] = '>';
                Fields[fi][max(fj,tj)] = '<';
            }
            else{
                Fields[min(fi,ti)][fj] = 'v';
                Fields[max(fi,ti)][fj] = '^';
            }
        }
    }

    // output
    cout << ans << "\n";
    for(auto f:Fields){
        cout << f << "\n";
    }
      
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/maxflow: No such file or directory
    2 | #include <atcoder/maxflow>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<int>>;
using pp=pair<ll,pair<ll,ll>>;
#define MAX 1000000
#define MOD 1000000007
#define INF 1000000000000000000

int main(){
  int N,M;
  cin>>N>>M;
  vector<string> S(N);
  for(int i=0;i<N;i++){
    cin>>S[i];
  }

  int dx={1,0,-1,0};
  int dy={0,1,0,-1};
  mf_graph<int> G(N*M+2);
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
      if((i+j)%2==0){
        if(S[i][j]=='.'){
          G.add_edge(N*M,i*M+j,1);
          for(int k=0;k<4;k++){
            int ni=i+dx[k];
            int nj=j+dy[k];
            if(ni<0||nj<0||ni>=N||nj>=M){
              continue;
            }
            if(S[ni][nj]=='.'){
              G.add_edge(i*M+j,ni*M+nj,1);
            }
          }
        }
      }else{
        if(S[i][j]=='.'){
          G.add_edge(i*M+j,N*M+1,1);
        }
      }
    }
  }

  cout<<G.flow(N*M,N*M+1)<<endl;
  vector<mf_graph<int>::edge> a=graph.edges();
  int n=a.size();
  for(int i=0;i<n;i++){
    if(a[i].from==N*M){
      continue;
    }
    if(a[i].to==N*M+1){
      continue;
    }
    if(a[i].flow==0){
      continue;
    }
    int i1=a[i].from/M;
    int j1=a[i].from%M;
    int i2=a[i].to/M;
    int j2=a[i].to%M;
    if(i1+1==i2){
      S[i1][j1]='v';
      S[i2][j2]='^';
    }else if(i1==i2+1){
      S[i1][j1]='^';
      S[i2][j2]='v';
    }else if(j1+1==j2){
      S[i1][j1]='>';
      S[i2][j2]='<';
    }else{
      S[i1][j1]='<';
      S[i2][j2]='>';
    }
  }

  for(int i=0;i<N;i++){
    cout<<S[i]<<endl;
  }
}


Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

#define N 128
mf_graph<int> graph(N*N);
char s[N][N] = {};
int dy[4] = {1, 0, -1, 0};
int dx[4] = {0, 1, 0, -1};
char c[5] = "v>^<";

int main(){
	int n, m; scanf("%d%d", &n, &m);
	REP(i, n) scanf("%s", s[i+1]+1);
	FOR(i, 1, n+1){
		FOR(j, 1, n+1){
			if( (i+j) % 2 ){
				graph.add_edge(0, i*N+j, 1);
				if(s[i][j] != '.') continue;
				REP(h, 4){
					int y = i + dy[h], x = j + dx[h];
					if(s[y][x] != '.') continue;
					graph.add_edge(i*N+j, y*N+x, 1);
				}
			} else {
				graph.add_edge(i*N+j, 1, 1);
			}
		}
	}
	int res = graph.flow(0, 1);
	printf("%d\n", res);
	for(auto e : graph.edges()){
		int i = e.from / N, j = e.from % N;
		int y = e.to / N, x = e.to % N;
		if(!e.flow) continue;
		REP(h, 4){
			if(i + dy[h] != y || j + dx[h] != x) continue;
			s[i][j] = c[h];
			s[y][x] = c[h^2];
		}
	}
	REP(i, n) printf("%s\n", s[i+1]+1);
}



Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで
// g++ hoge.cpp -std=c++17 -I . でコンパイルできる
// -fsanitize=undefinedでオーバーフロー検出
#include <bits/stdc++.h>
#include <atcoder/all>

#define mod 1000000007
#define INF LLONG_MAX
#define ll int
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
using namespace atcoder;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);

    ll a,b,c,d,m,n,maxi=0,f=0,mini=INF,sum=0;
    ll k;
    ll g,e;
    ll q;
    cin>>n>>m;
    string s[n];
    rep(i,n) cin>>s[i];

    //どれに始点とどれに終点をつければいいかわかりません
    mf_graph<int> graph(m*n+2);
    rep(i,n){
        rep(j,m){
            if(s[i][j]=='.'){
                graph.add_edge(m*n,i*n+j,1);
            //    graph.add_edge(m*n+1,i*n+j,1);
                //graph.add_edge(i*n+j,n*m,1);
                graph.add_edge(i*n+j,n*m+1,1);
                
                if(1<=i&&s[i-1][j]=='.'){
                       // graph.add_edge(i*n+j,(i-1)*n+j,1);
                       // graph.add_edge((i-1)*n+j,i*n+j);
                }if(1<=j&&s[i][j-1]=='.'){
                       // graph.add_edge(i*n-j+1,i*n+j,1);
                       // graph.add_edge(i*n+j,i*n+j-1);
                }if(i<n-1&&s[i+1][j]=='.'){
                      //  graph.add_edge(i*n+j,(i+1)*n+j,1);
                       // graph.add_edge((i+1)*n+j,i*n+j);
                }if(j<m-1&&s[i+1][j]=='.'){
                       // graph.add_edge(i*n+j+1,i*n+j,1);
                        //graph.add_edge(i*n+j,i*n+j+1);
                }

            }
        }
    }
    cout<<graph.flow(m*n,m*n+1)<<endl;

    return 0;
}


Compiler output:
a.cc:5:10: fatal error: atcoder/all: No such file or directory
    5 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

// -----------------------------------
// author   : MatsuTaku
// country  : Japan
// created  : 09/08/20 03:55:25
// -----------------------------------

#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using ll = long long;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);

  int n,m; cin>>n>>m;
  vector<string> grid(n); for (auto& l:grid) cin>>l;

  atcoder::mf_graph<int> mfg(n*m+2);
  int qs = n*m, qg = n*m+1;
  vector<int> ei;
  constexpr int dir[4][2] = {
      {1, 0}, {0, 1},
      {-1, 0}, {0, -1},
  };
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (grid[i][j] == '#') continue;
      if ((i+j)%2) {
        mfg.add_edge(qs, i*m+j, 1);
        for (auto [dx, dy] : dir) {
          int x = i + dx, y = j + dy;
          if (x < 0 or x >= n or y < 0 or y >= m or
              grid[x][y] == '#')
            continue;
          ei.push_back(
              mfg.add_edge(i*m+j, x*m+y, 1)
              );
        }
      } else {
        mfg.add_edge(i*m+j, qg, 1);
      }
    }
  }
  int ans = mfg.flow(qs, qg);
  cout << ans << endl;
  for (auto e : ei) {
    auto [s, t, c, f] = mfg.get_edge(e);
    if (f == 0) continue;
    if (s > t) swap(s, t);
    if (t-s == 1) {
      grid[s/m][s%m] = '>';
      grid[t/m][t%m] = '<';
    } else if (t-s == m) {
      grid[s/m][s%m] = 'v';
      grid[t/m][t%m] = '^';
    }
  }
  for (auto& l : grid)
    cout << l << endl;

  return 0;
}


Compiler output:
a.cc:8:10: fatal error: atcoder/all: No such file or directory
    8 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/maxflow>
#include <iostream>

using namespace std;
using namespace atcoder;

int main() {
    int n, m;
    cin >> n >> m;

    vector<string> grid(n);
    for (int i = 0; i < n; i++) {
        cin >> grid[i];
    }

    /**
     * generate (s -> even grid -> odd grid -> t) graph
     * grid(i, j) correspond to vertex (i * m + j)
     **/
    mf_graph<int> g(n * m + 2);
    int s = n * m, t = n * m + 1;

    // s -> even / odd -> t
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (grid[i][j] == '#') continue;
            int v = i * m + j;
            if ((i + j) % 2 == 0) {
                g.add_edge(s, v, 1);
            } else {
                g.add_edge(v, t, 1);
            }
        }
    }

    // even -> odd
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if ((i + j) % 2 || grid[i][j] == '#') continue;
            int v0 = i * m + j;
            if (i && grid[i - 1][j] == '.') {
                int v1 = (i - 1) * m + j;
                g.add_edge(v0, v1, 1);
            }
            if (j && grid[i][j - 1] == '.') {
                int v1 = i * m + (j - 1);
                g.add_edge(v0, v1, 1);
            }
            if (i + 1 < n && grid[i + 1][j] == '.') {
                int v1 = (i + 1) * m + j;
                g.add_edge(v0, v1, 1);
            }
            if (j + 1 < m && grid[i][j + 1] == '.') {
                int v1 = i * m + (j + 1);
                g.add_edge(v0, v1, 1);
            }
        }
    }

    cout << g.flow(s, t) << endl;

    auto edges = g.edges();
    for (auto e : edges) {
        if (e.from == s || e.to == t || e.flow == 0) continue;
        int i0 = e.from / m, j0 = e.from % m;
        int i1 = e.to / m, j1 = e.to % m;

        if (i0 == i1 + 1) {
            grid[i1][j1] = 'v';
            grid[i0][j0] = '^';
        } else if (j0 == j1 + 1) {
            grid[i1][j1] = '>'; grid[i0][j0] = '<';
        } else if (i0 == i1 - 1) {
            grid[i0][j0] = 'v';
            grid[i1][j1] = '^';
        } else {
            grid[i0][j0] = '>'; grid[i1][j1] = '<';
        }
    }

    for (int i = 0; i < n; i++) {
        cout << grid[i] << endl;
    }

    return 0;
}

Compiler output:
a.cc:1:10: fatal error: atcoder/maxflow: No such file or directory
    1 | #include <atcoder/maxflow>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++


#include <atcoder/all>
using namespace atcoder;
 
// Problem
void solve() {
    VAR(ll, n, k); //
 
    const ll BIG = 1'000'000'000;
 
    /**
     * generate (S -> row -> column -> T) graph
     * i行目 -> i
     * j列目 -> n + j
     **/
    mcf_graph<int, ll> g(2 * n + 2);
    int S = 2 * n, T = 2 * n + 1;
 
    // we can "waste" the flow
    g.add_edge(S, T, n * k, BIG);
 
    REP(i, 0, n) {
        g.add_edge(S, i, k, 0);     // i 行目に k だけ流せる
        g.add_edge(n + i, T, k, 0); // j 列目に k だけ流せる
    }
 
    REP(i, 0, n) REP(j, 0, n) {
        VAR(ll, a);
        g.add_edge(i, n + j, 1, BIG - a); // (i,j) に流すと a だけ得する
    }
 
    pair<int, ll> result = g.flow(S, T, n * k); // S->T で流す
    cout << (n * k * BIG - result.second) << endl;
 
    vc<string> grid(n, string(n, '.'));
    auto edges = g.edges();
    for (auto e : edges) {
        if (e.from == S || e.to == T || e.flow == 0) continue;
 
        grid[e.from][e.to - n] = 'X';
    }
 
    REP(i, 0, n) cout << grid[i] << endl;
}
 
// entry point
int main() {
    solve();
    return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/mincostflow>
#include <atcoder/maxflow.hpp>
using namespace std;
#ifdef __DEBUG__
    void debug_out() { cerr << endl; } 
    template <typename Head, typename... Tail>
    void debug_out(Head H, Tail... T) {cerr << " " << H; debug_out(T...);}
    #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) 
#endif

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N,K;
vector<vector<ll>> A;
inline void input(){
    fast_io();
    cin >> N >> K;
    A.assign(N,vector<ll>(N,0));
    for (int i = 0; i < N; i++)
        for (int j = 0; j < N; j++)
            cin >> A[i][j];
}

inline int solve(){
    atcoder::mcf_graph<ll, ll> g(2*N+10);
    int s = 0, t = 2*N+1;
    ll INF = 1e9;
    for (int i = 1; i <= N; i++)
    {
        g.add_edge(s, i, K, 0);
        g.add_edge(N+i, t, K, 0);
    }
    g.add_edge(s, t, N*K, INF);
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            g.add_edge(i+1, N+j+1, 1, INF - A[i][j]);
        }
    }
    ll _cap, cost;
    tie(_cap, cost) = g.flow(s, t, N*K);
    // cout << cap << endl;
    cout << (N*K*INF - cost) << endl;
    vector<string> Ans(N,string(N,'.'));
    for(auto e:g.edges()){
        int i = e.from-1;
        int j = e.to-N-1;
        if(e.flow==1 && 0<=i && i<N && 0<=j && j<N){
            Ans[i][j] = 'X';
        }
        // debug(e.from, e.to, e.cap, e.cost, e.flow);
    }
    for(auto a:Ans) cout << a << endl;
    
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/mincostflow: No such file or directory
    2 | #include <atcoder/mincostflow>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>
#include <random>

#include <atcoder/all>

#define FOR_LT(i, beg, end) for (int i = (int)(beg); i < (int)(end); i++)
#define FOR_LE(i, beg, end) for (int i = (int)(beg); i <= (int)(end); i++)
#define FOR_DW(i, beg, end) for (int i = (int)(beg); (int)(end) <= i; i--)
#define REP(n)              for (int repeat_index = 0; repeat_index < (int)n; repeat_index++)

using namespace std;


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(20);

	int n, k; cin >> n >> k;

	int s = 2 * n;
	int t = 2 * n + 1;

	atcoder::mcf_graph<int32_t, int64_t> mcf(2 * n + 2);

	int64_t kBig = 1000000000;
	
	mcf.add_edge(s, t, n * k, kBig);
	FOR_LT(i, 0, n) {
		mcf.add_edge(s, i, k, 0);
		mcf.add_edge(n + i, t, k, 0);
	}

	FOR_LT(i, 0, n) {
		FOR_LT(j, 0, n) {
			int a; cin >> a;
			mcf.add_edge(i, n + j, 1, kBig - a);
		}
	}

	auto ret = mcf.flow(s, t, n * k);

	cout << kBig * k * n - ret.second << endl;

	auto edges = mcf.edges();

	vector<string> ans(n, string(n, '.'));
	for (auto& edge : edges) {
		if (edge.flow == 0) continue;
		if (edge.from == s) continue;
		if (edge.to == t) continue;

		ans[edge.from][edge.to - n] = 'X';
	}

	for (auto& a : ans) {
		cout << a << endl;
	}

	return 0;
}

Compiler output:
a.cc:28:10: fatal error: atcoder/all: No such file or directory
   28 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a/gcd(a, b) * b;
}

const ll BIG = 1'000'000'000;

int main()
{
    cout << fixed << setprecision(15);
    ll N, K;
    cin >> N >> K;

    mcf_graph<ll, ll> G(2*N + 2);
    ll s = 2*N;
    ll t = 2*N + 1;

    // 捨てる辺(K以下なので、使わない場合はここを通すイメージ)
    G.add_edge(s, t, N*K, BIG);

    // s,tと結ぶ辺
    REP(i, N){
        G.add_edge(s, i, K, 0);
        G.add_edge(N+i, t, K, 0);
    }

    REP(i, N){
        REP(j, N){
            ll a;
            cin >> a;

            // 辺を張る
            G.add_edge(i, N+j, 1, BIG-a);
        }
    }

    auto result = G.flow(s, t, N*K);

    cout << N*K*BIG - result.second << endl;

    vector<vector<char>> ans(N, vector<char>(N, '.'));

    auto edges = G.edges();
    for (auto e : edges) {
        if (e.from == s || e.to == t || e.flow == 0) continue;

        // cout << e.from << " " << e.to << endl;
        ll v0 = e.from;
        ll v1 = e.to - N;
        ans[v0][v1] = 'X';
    }

    REP(i, N){
        REP(j, N){
            cout << ans[i][j];
        }
        cout << endl;
    }

    return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

//#include <tourist>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> p;
const ll INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//g++ yarudake.cpp -std=c++17 -I .
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    mcf_graph<ll, ll> g(2 * n + 2);
    vector<vector<char>> m(n, vector<char>(n, '.'));
    rep(i, n)
    {
        rep(j, n)
        {
            ll a;
            cin >> a;
            g.add_edge(i, n + j, 1, INF - a);
        }
    }
    rep(i, n)
    {
        g.add_edge(2 * n, i, k, 0);
        g.add_edge(i + n, 2 * n + 1, k, 0);
    }
    g.add_edge(2*n,2*n+1,n*k,INF);
    pair<ll, ll> ans = g.flow(2 * n, 2 * n + 1,n*k);
    cout << n*k * INF - ans.second << "\n";
    vector<mcf_graph<ll, ll>::edge> v = g.edges();
    rep(i, v.size())
    {
        if (v[i].from == 2 * n || v[i].to == 2 * n + 1 || v[i].flow == 0)
            continue;
        m[v[i].from][v[i].to - n] = 'X';
    }
    rep(i, n)
    {
        rep(j, n)
        {
            cout << m[i][j];
        }
        cout << "\n";
    }
}

Compiler output:
a.cc:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

use ac_library_rs::MinCostFlowGraph;
use std::io::Read;

const MAX: i64 = 1_000_000_000;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    let n = input.next().unwrap().parse().unwrap();
    let k = input.next().unwrap().parse().unwrap();
    let a: Vec<Vec<i64>> = (0..n)
        .map(|_| input.by_ref().take(n).map(|s| s.parse().unwrap()).collect())
        .collect();

    let mut graph = MinCostFlowGraph::new(102);
    for i in 0..n {
        for j in 0..n {
            graph.add_edge(i, 50 + j, 1, MAX - a[i][j]);
        }
    }
    for i in 0..n {
        graph.add_edge(100, i, k, 0);
        graph.add_edge(50 + i, 101, k, 0);
    }
    graph.add_edge(100, 101, n as i64 * k, MAX);

    let (max_flow, min_cost) = graph.flow(100, 101, n as i64 * k);
    println!("{}", max_flow * MAX - min_cost);

    (0..n)
        .map(|i| {
            (0..n)
                .map(|j| match graph.get_edge(i * n + j).flow {
                    1 => 'X',
                    _ => '.',
                })
                .collect()
        })
        .for_each(|s: String| println!("{}", s));
}


Compiler output:
a.cc:13:29: error: too many decimal points in number
   13 |     let a: Vec<Vec<i64>> = (0..n)
      |                             ^~~~
a.cc:18:14: error: too many decimal points in number
   18 |     for i in 0..n {
      |              ^~~~
a.cc:19:18: error: too many decimal points in number
   19 |         for j in 0..n {
      |                  ^~~~
a.cc:23:14: error: too many decimal points in number
   23 |     for i in 0..n {
      |              ^~~~
a.cc:32:6: error: too many decimal points in number
   32 |     (0..n)
      |      ^~~~
a.cc:34:14: error: too many decimal points in number
   34 |             (0..n)
      |              ^~~~
a.cc:1:1: error: 'use' does not name a type
    1 | use ac_library_rs::MinCostFlowGraph;
      | ^~~
a.cc:2:1: error: 'use' does not name a type
    2 | use std::io::Read;
      | ^~~
a.cc:4:10: error: found ':' in nested-name-specifier, expected '::'
    4 | const MAX: i64 = 1_000_000_000;
      |          ^
      |          ::
a.cc:4:7: error: 'MAX' does not name a type
    4 | const MAX: i64 = 1_000_000_000;
      |       ^~~
a.cc:6:1: error: 'fn' does not name a type
    6 | fn main() {
      | ^~