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

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <vector>
#include <string>
#include <bitset>
#include <stack>
#include <queue>
#include <tuple>
#include <regex>
#include <cmath>
#include <map>
#include <set>
#include <functional>
#include <cstring>

using namespace std;

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

using ll = long long;
using Pint = pair<int, int>;
using Pll  = pair<ll, ll>;

#define eb emplace_back
#define pb push_back
#define mp make_pair

#define F first
#define S second

#define popcnt __builtin_popcountll

#define rep( i, n ) for ( ll i = 0; i < (ll)( n ); ++i )
#define reps( i, n ) for ( ll i = 1; i <= (ll)( n ); ++i )
#define rrep( i, n ) for ( ll i = (ll)( ( n ) - 1 ); i >= 0; --i )
#define rreps( i, n ) for ( ll i = (ll)( ( n ) ); i > 0; --i )
#define arep( i, v ) for ( auto &&i : ( v ) )

#define ALL( c ) ( c ).begin(), ( c ).end()
#define RALL( c ) ( c ).rbegin(), ( c ).rend()
#define UNIQUE( c ) ( c ).erase( unique( ( c ).begin(), ( c ).end() ), ( c ).end() )

template<typename T = ll> constexpr T MAX = numeric_limits<T>::max();
template<typename T> T gcd( const T a, const T b ) { return ( b ? gcd( b, a % b ) : a ); }
template<typename T> T lcm( const T a, const T b ) { return ( a / gcd( a, b ) * b ); }

struct S{
    long long value;
    int size;
};
using F = long long;

const F ID = 8e18;

S op(S a, S b){ return {a.value+b.value, a.size+b.size}; }
S e(){ return {0, 0}; }
S mapping(F f, S x){
    if(f != ID) x.value = f*x.size;
    return x;
}
F composition(F f, F g){ return (f == ID ? g : f); }
F id(){ return ID; }

constexpr ll MOD = 998244353LL;

int main(){
    int N, Q; cin >> N >> Q;
    std::vector<S> v(N, {1, 1});
    atcoder::lazy_segtree<S, op, e, F, mapping, composition, id> seg(v);

	rep( i, Q )
	{
		ll l, r, d;
		cin >> l >> r >> d;
		--l; --r;
		seg.apply( l, r + 1, d );

		ll ans = 0;
		rep( i, N )
		{
			ans %= MOD;
			ans *= 10;
			ans += seg.prod( i, i + 1 ).value;
		}

		cout << ( ans % MOD ) << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:5: error: 'atcoder' has not been declared
   72 |     atcoder::lazy_segtree<S, op, e, F, mapping, composition, id> seg(v);
      |     ^~~~~~~
a.cc:72:28: error: expected primary-expression before ',' token
   72 |     atcoder::lazy_segtree<S, op, e, F, mapping, composition, id> seg(v);
      |                            ^
a.cc:72:38: error: expected primary-expression before ',' token
   72 |     atcoder::lazy_segtree<S, op, e, F, mapping, composition, id> seg(v);
      |                                      ^
a.cc:72:66: error: 'seg' was not declared in this scope
   72 |     atcoder::lazy_segtree<S, op, e, F, mapping, composition, id> seg(v);
      |                                                                  ^~~
Language: C++

n, q = map(int, input().split())
s = "1" * n

for i in range(q) :
    l, r, d = map(int, input().split())
    l -= 1
    r -= 1
    L = []
    L.append(s[0:l])
    L.append(str(d) * (r-l+1))
    L.append(s[r+1:n])
    s = ''.join(L)
    print(int(s) % 998244353)


Compiler output:
a.cc:12:9: error: empty character constant
   12 |     s = ''.join(L)
      |         ^~
a.cc:1:1: error: 'n' does not name a type
    1 | n, q = map(int, input().split())
      | ^
Language: C++

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <vector>
#include <string>
#include <bitset>
#include <stack>
#include <queue>
#include <tuple>
#include <regex>
#include <cmath>
#include <map>
#include <set>
#include <functional>
#include <cstring>

#include <lazysegtree.hpp>

using namespace std;

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

using ll = long long;
using Pint = pair<int, int>;
using Pll  = pair<ll, ll>;

#define eb emplace_back
#define pb push_back
#define mp make_pair

#define F first
#define S second

#define popcnt __builtin_popcountll

#define rep( i, n ) for ( ll i = 0; i < (ll)( n ); ++i )
#define reps( i, n ) for ( ll i = 1; i <= (ll)( n ); ++i )
#define rrep( i, n ) for ( ll i = (ll)( ( n ) - 1 ); i >= 0; --i )
#define rreps( i, n ) for ( ll i = (ll)( ( n ) ); i > 0; --i )
#define arep( i, v ) for ( auto &&i : ( v ) )

#define ALL( c ) ( c ).begin(), ( c ).end()
#define RALL( c ) ( c ).rbegin(), ( c ).rend()
#define UNIQUE( c ) ( c ).erase( unique( ( c ).begin(), ( c ).end() ), ( c ).end() )

template<typename T = ll> constexpr T MAX = numeric_limits<T>::max();
template<typename T> T gcd( const T a, const T b ) { return ( b ? gcd( b, a % b ) : a ); }
template<typename T> T lcm( const T a, const T b ) { return ( a / gcd( a, b ) * b ); }

struct S{
    long long value;
    int size;
};
using F = long long;

const F ID = 8e18;

S op(S a, S b){ return {a.value+b.value, a.size+b.size}; }
S e(){ return {0, 0}; }
S mapping(F f, S x){
    if(f != ID) x.value = f*x.size;
    return x;
}
F composition(F f, F g){ return (f == ID ? g : f); }
F id(){ return ID; }

constexpr ll MOD = 998244353LL;

int main(){
    int N, Q; cin >> N >> Q;
    std::vector<S> v(N, {1, 1});
    atcoder::lazy_segtree<S, op, e, F, mapping, composition, id> seg(v);

	rep( i, Q )
	{
		ll l, r, d;
		cin >> l >> r >> d;
		--l; --r;
		seg.apply( l, r + 1, d );

		ll ans = 0;
		rep( i, N )
		{
			ans %= MOD;
			ans *= 10;
			ans += seg.prod( i, i + 1 ).value;
		}

		cout << ( ans % MOD ) << endl;
	}
}


Compiler output:
a.cc:18:10: fatal error: lazysegtree.hpp: No such file or directory
   18 | #include <lazysegtree.hpp>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <vector>
#include <string>
#include <bitset>
#include <stack>
#include <queue>
#include <tuple>
#include <regex>
#include <cmath>
#include <map>
#include <set>
#include <functional>
#include <cstring>

#include "lazysegtree.hpp"

using namespace std;

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

using ll = long long;
using Pint = pair<int, int>;
using Pll  = pair<ll, ll>;

#define eb emplace_back
#define pb push_back
#define mp make_pair

#define F first
#define S second

#define popcnt __builtin_popcountll

#define rep( i, n ) for ( ll i = 0; i < (ll)( n ); ++i )
#define reps( i, n ) for ( ll i = 1; i <= (ll)( n ); ++i )
#define rrep( i, n ) for ( ll i = (ll)( ( n ) - 1 ); i >= 0; --i )
#define rreps( i, n ) for ( ll i = (ll)( ( n ) ); i > 0; --i )
#define arep( i, v ) for ( auto &&i : ( v ) )

#define ALL( c ) ( c ).begin(), ( c ).end()
#define RALL( c ) ( c ).rbegin(), ( c ).rend()
#define UNIQUE( c ) ( c ).erase( unique( ( c ).begin(), ( c ).end() ), ( c ).end() )

template<typename T = ll> constexpr T MAX = numeric_limits<T>::max();
template<typename T> T gcd( const T a, const T b ) { return ( b ? gcd( b, a % b ) : a ); }
template<typename T> T lcm( const T a, const T b ) { return ( a / gcd( a, b ) * b ); }

struct S{
    long long value;
    int size;
};
using F = long long;

const F ID = 8e18;

S op(S a, S b){ return {a.value+b.value, a.size+b.size}; }
S e(){ return {0, 0}; }
S mapping(F f, S x){
    if(f != ID) x.value = f*x.size;
    return x;
}
F composition(F f, F g){ return (f == ID ? g : f); }
F id(){ return ID; }

constexpr ll MOD = 998244353LL;

int main(){
    int N, Q; cin >> N >> Q;
    std::vector<S> v(N, {1, 1});
    atcoder::lazy_segtree<S, op, e, F, mapping, composition, id> seg(v);

	rep( i, Q )
	{
		ll l, r, d;
		cin >> l >> r >> d;
		--l; --r;
		seg.apply( l, r + 1, d );

		ll ans = 0;
		rep( i, N )
		{
			ans %= MOD;
			ans *= 10;
			ans += seg.prod( i, i + 1 ).value;
		}

		cout << ( ans % MOD ) << endl;
	}
}


Compiler output:
a.cc:18:10: fatal error: lazysegtree.hpp: No such file or directory
   18 | #include "lazysegtree.hpp"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	int N,Q;
  	cin>>N>>Q;
  	vector<vector<int>> data(Q, vector<int>(N));
  	for(int i=0;i<Q;i++){
    	for(int j=0;j<N;j++){
        	data.at(i).at(j)=1;
        }
    }
  	vector<int> L(Q);
  	vector<int> R(Q);
  	vector<int> D(Q);
  	for(int i=0;i<Q;i++){
    	cin>>L.at(i)>>R.at(i)>>D.at(i);
    }
  	vector<int> str(N);
  	for(int i=0;i<Q;i++){
    	for(int j=L.at(i);j<=R.at(i);j++){
        	data.at(i).at(j)=D.at(i);
          	str.push_back(data.at(i).at(j));
        }
     	cout<<str(i)%998244353<<endl;
    }
  	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: no match for call to '(std::vector<int>) (int&)'
   24 |         cout<<str(i)%998244353<<endl;
      |               ~~~^~~
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MAXN = 2e5 + 5;
const int MAXQ = 2e5 + 5;
const int mod = 998244353;

ll pw[MAXN], psum[MAXN];

struct Segment_Tree
{
	ll sum[MAXN<<2];
	int tag[MAXN<<2];
	#define ls(u) ((u)<<1)
	#define rs(u) ((u)<<1|1)
	#define lson(u) ls(u),l,mid
	#define rson(u) rs(u),mid+1,r
	inline void push_up(int u){ sum[u] = (sum[ls(u)] + sum[rs(u)]) %mod;}
	inline void push_down(int u,int l,int r)
	{
		if(~tag[u])
		{
			int mid = (l+r)>>1;
			sum[ls(u)] = tag[u] * (psum[r] - psum[mid] + mod) %mod;
			sum[rs(u)] = tag[u] * (psum[mid] - psum[l-1] + mod) %mod;
			tag[ls(u)] = tag[rs(u)] = tag[u];
			tag[u] = -1;
		}
	}
	void build(int u,int l,int r)
	{
		tag[u] = -1;
		if(l==r){ sum[u] = pw[l]; return;}
		int mid = (l+r)>>1;
		build(lson(u)); build(rson(u));
		push_up(u);
	}
	void update(int u,int l,int r,int ql,int qr,int k)
	{
		if(ql<=l && r<=qr){ sum[u] = k * (psum[r] - psum[l-1] + mod) %mod; tag[u] = k; return;}
		push_down(u);
		int mid = (l+r)>>1;
		if(ql<=mid) update(lson(u),ql,qr,k);
		if(mid<qr) update(rson(u),ql,qr,k);
		push_up(u);
	}
	ll query_all(void){ return sum[1];}
}tree;

int main(void)
{
	pw[1] = psum[1] = 1;
	for(int i=2; i<MAXN; ++i)
		pw[i] = pw[i-1] * 10 %mod,
		psum[i] = (psum[i-1] + pw[i]) %mod;
	
	int n,Q;
	scanf("%d%d",&n,&Q);
	
	tree.build(1,1,n);
	
	while(Q--)
	{
		int l,r,k;
		scanf("%d%d%d",&l,&r,&k);
		tree.update(1,1,n, n-r+1, n-l+1, k);
		printf("%lld\n",tree.query_all());
	}
	return 0;
}

Compiler output:
a.cc: In member function 'void Segment_Tree::update(int, int, int, int, int, int)':
a.cc:47:26: error: no matching function for call to 'Segment_Tree::push_down(int&)'
   47 |                 push_down(u);
      |                 ~~~~~~~~~^~~
a.cc:25:21: note: candidate: 'void Segment_Tree::push_down(int, int, int)'
   25 |         inline void push_down(int u,int l,int r)
      |                     ^~~~~~~~~
a.cc:25:21: note:   candidate expects 3 arguments, 1 provided
Language: C++

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

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;
using namespace atcoder;

using mint=modint998244353;

using S=pair<mint,int>;
using F=int;
S op(S x,S y){
	return make_pair(x.first*mint(10).pow(y.second)+y.first,x.second+y.second);
}
S e(){ return make_pair(mint(0),0); }
S mapping(F f,S x){
	if(f==0){
		return x;
	}
	else{
		int len=x.second;
		return make_pair((mint(10).pow(len)-1)/9*f,len);
	}
}
F composition(F f,F g){ return f==0?g:f; }
F id(){ return 0; }

int main(){
	int n,q; scanf("%d%d",&n,&q);

	lazy_segtree<S,op,e,F,mapping,composition,id> ST(n);
	rep(i,n) ST.set(i,make_pair(mint(1),1));

	rep(i,q){
		int l,r,d; scanf("%d%d%d",&l,&r,&d); l--;
		ST.apply(l,r,d);
		printf("%d\n",ST.all_prod().first.val());
	}

	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 <iostream>
#define M 998244353
#define ll long long
#define MAX 2000005
using namespace std;

ll pre[MAX];
ll power(ll x,ll y){
    if(y==0)
        return 1ll%M;
    ll val=power(x,y/2);
    if(y%2==1)
        return ((val*val)%M*x)%M;
    return (val*val)%M;
}
void buildTree(ll *a,ll *tree,ll s,ll e,ll i){
    if(s==e){
        tree[i]=a[i];
        return;
    }
    ll m=(s+e)/2;
    buildTree(a,tree,s,m,2*i);
    buildTree(a,tree,m+1,e,2*i+1);
    tree[i]=(tree[2*i]*power(10,e-m))%M+tree[2*i+1]%M;
    tree[i]%=M;
}

void updateTreeLazy(ll *lazy,ll *tree,ll s,ll e,ll l,ll r,ll i,ll val){
    if(lazy[i]!=-1){
        tree[i]=(lazy[i]*pre[e-s])%M;
        if(s!=e){
            lazy[2*i]=lazy[i];
            lazy[2*i+1]=lazy[i];
        }
        lazy[i]=-1;
    }
    if(s>e || s>r || e<l)
        return;
    //Complete Overlap
    if(s>=l && e<=r){
        tree[i]=val*pre[e-s];
        if(s!=e){
            lazy[2*i]=val;
            lazy[2*i+1]=val;
        }
        return;
    }
    ll m=(s+e)/2;
    updateTreeLazy(lazy,tree,s,m,l,r,2*i,val);
    updateTreeLazy(lazy,tree,m+1,e,l,r,2*i+1,val);
    tree[i]=(tree[2*i]*power(10,e-m))%M+tree[2*i+1]%M;
    tree[i]%=M;

}
int main()
{
    ll n,q;
    cin>>n>>q;
    ll arr[n];
    for(ll i=0;i<n;i++){
        arr[i]=1;
    }
    pre[0]=1;
    for(ll i=1;i<MAX;i++){
        pre[i]=((pre[i-1]*10)%M+1)%M;
    }
    ll *tree=new ll[4*n]();
    ll *lazy=new ll[4*n];
    for(ll i=0;i<4*n;i++){
        lazy[i]=-1;
        tree[i]=0;
    }
    buildTree(a,tree,s,e,i);
    for(ll i=0;i<q;i++){
        ll l,r,x;
        cin>>l>>r>>x;
        updateTreeLazy(lazy,tree,0,n-1,l-1,r-1,1,x);
        cout<<tree[1]%M<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:73:15: error: 'a' was not declared in this scope
   73 |     buildTree(a,tree,s,e,i);
      |               ^
a.cc:73:22: error: 's' was not declared in this scope
   73 |     buildTree(a,tree,s,e,i);
      |                      ^
a.cc:73:24: error: 'e' was not declared in this scope
   73 |     buildTree(a,tree,s,e,i);
      |                        ^
a.cc:73:26: error: 'i' was not declared in this scope
   73 |     buildTree(a,tree,s,e,i);
      |                          ^
Language: C++

#include <iostream>
#include <string>
using namespace std;


int main() {
  int n, q;
  cin >> n >> q;
  string s(n, '1');
  cout << s << endl;

  int l, r;
  char d;
  for (int i = 0; i < q; i++) {
    cin >> l >> r >> d;
    string sub(r-l, d);
    s.replace(l, r-l, sub);
    int ans = atoi(s) % 998244353;
    cout << ans;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   18 |     int ans = atoi(s) % 998244353;
      |                    ^
      |                    |
      |                    std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

n,q = gets.split.map(&:to_i)
l = Array.new(n+1)
r = Array.new(n+1)
d = Array.new(n+1)
ans = (10**(n+1)-1)/9
for j in 1..q
	l[j],r[j],d[j] = gets.split.map(&:to_i)
	a=10**(n-r[j]+1)
	ans = (ans/10**(n-l[j]+2))*(10**(n-l[j]+2))+ans%a
	ans += d[j]*(((10**(n-l[j]+2)-1)/9)-(10**(n-r[j]+1)-1)/9)
	puts ans%998244353
end	

Compiler output:
a.cc:6:10: error: too many decimal points in number
    6 | for j in 1..q
      |          ^~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n,q = gets.split.map(&:to_i)
      | ^
Language: C++

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

long long M = 998244353;

struct S
{
    long long value;
    int size;
};

long long powmod(long long a, long long b, long long m)
{
    long long r = 1;
    for (; b>0; b>>=1, a=a*a%m)
        if (b&1)
            r = r*a%m;
    return r;
}

S op(S a, S b)
{
    return {
        (a.value*powmod(10, b.size, M)%M+b.value)%M,
        a.size+b.size
    };
}

S e()
{
    return {0, 0};
}

vector<long long> one(1, 0);

S mapping(long long f, S x)
{
    while ((int)one.size()<=x.size)
    {
        one.push_back((one.back()*10+1)%M);
    }

    if (f>=0)
        x.value = one[x.size]*f%M;
    return x;
}

long long composition(long long f, long long g)
{
    return f<0 ? g : f;
}

long long id()
{
    return -1;
}

int main()
{
    int N, Q;
    cin>>N>>Q;

    lazy_segtree<S, op, e, long long, mapping, composition, id> LST(vector<S>(N, {1, 1}));
    for (int q=0; q<Q; q++)
    {
        int L, R, D;
        cin>>L>>R>>D;

        LST.apply(L-1, R, D);
        cout<<LST.all_prod().value<<endl;
    }
}


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

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD9=1000000007;
const ll MOD=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
struct S{
    ll value;
    ll size;
};
using F = ll;
const F ID = ll(2e9);
S op(S a, S b){ return {a.value+b.value, a.size+b.size}; }
S e(){ return {0, 0}; }
S mapping(F f, S x){
    if(f != ID) x.value = x.size * f;
    return x;
}
F composition(F f, F g){ return (f == ID ? g : f); }
F id(){ return ID; }

int main(){
  ll n,q; cin>>n>>q;
  vector<S> v(n,{1,1});
  lazy_segtree<S, op, e, F, mapping, composition, id> seg(v);
   
  rep(i,q){
    ll l,r,d; cin>>l>>r>>d;
    seg.apply(l-1,r,d);
  }
  mint ans = 0;
  mint ke = 1;
  rep(i,n){
    ans += (mint)v[i].value*ke;
    ke *= 10;}
  cout << ans << endl;
  
  


Compiler output:
a.cc:2:9: 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;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007



template<typename T,typename E>
class LazySegtree{
  public:
  using F = function<T(T,T)>;
  using G = function<T(T,E)>;
  using H = function<E(E,E)>;
  int n,height;
  F f;
  G g;
  H h;
  T ti;
  E ei;
  vector<T> dat;
  vector<E> laz;
  LazySegtree(F f,G g,H h,T ti,E ei):
    f(f),g(g),h(h),ti(ti),ei(ei){}

  void init(int N){
    n = 1;height = 0;
    while(n < N)n <<= 1,height++;
    dat.assign(n << 1,ti);
    laz.assign(n << 1,ei);
  }
  void build(const vector<T> &v){
    int N = v.size();
    init(N);
    rep(i,N)dat[i+n] = v[i];
    for(int i = n-1;i > 0;i--)dat[i] = f(dat[(i<<1)|0],dat[(i<<1)|1]);
  }
  inline T reflect(int k){
    return (laz[k] == ei ? dat[k] : g(dat[k],laz[k]));
  }
  inline void eval(int k){
    if(laz[k] == ei)return;
    laz[(k<<1)|0] = h(laz[(k<<1)|0],laz[k]);
    laz[(k<<1)|1] = h(laz[(k<<1)|1],laz[k]);
    dat[k] = reflect(k);
    laz[k] = ei;
  }
  inline void thrust(int k){
    for(int i = height;i > 0;i--)eval(k >> i);
  }
  inline void recalc(int k){
    while(k >>= 1)dat[k] = f(reflect((k << 1)|0),reflect((k << 1)|1));
  }
  void update(int a,int b,E x){
    thrust(a+=n);
    thrust(b+=n-1);
    for(int l = a,r = b+1;l < r;l >>= 1,r >>= 1){
      if(l & 1)laz[l] = h(laz[l],x),l++;
      if(r & 1)r--,laz[r] = h(laz[r],x);
    }
    recalc(a);
    recalc(b);
  }
  void set_val(int a,T x){
    thrust(a+=n);
    dat[a] = x;laz[a] = ei;
    recalc(a);
  }
  T get(int a,int b){
    thrust(a+=n);
    thrust(b+=n-1);
    T vl = ti,vr = ti;
    for(int l = a,r = b+1;l < r;l >>= 1,r >>= 1){
      if(l & 1)vl = f(vl,reflect(l++));
      if(r & 1)vr = f(reflect(--r),vr);
    }
    return f(vl,vr);
  }
};
using Pl = pair<ll,int>;
const int mod = 998244353;

ll modpow(ll n,int r){
  ll res = 1;
  while(r){
    if(r & 1)res = res*n%mod;
    n = n*n%mod;
    r >>= 1;
  }
  return res;
}
int main(){
  
  int n,q;
  cin >> n >> q;
  auto f = [](Pl a,Pl b){
    return Pl{(a.first*modpow(10,b.second)%mod+b.first)%mod,a.second+b.second};
  };
  auto g = [](Pl a,ll b){
    Pl k = {0,a.second};
    k.first = (b*(modpow(10,a.second)-1)%mod)*modpow(9,mod-2)%mod;
    return k;
  };
  auto h = [](ll a,ll b){
    return b;
  };
  LazySegtree<Pl,ll> seg(f,g,h,Pl{0,0},(ll)998244353);
  seg.build(vector<Pl>(n,{1,1}));
  while(q--){
    int l,r,d;
    cin >> l >> r >> d;
    l--;
    seg.update(l,r,d);
    cout << seg.get(0,n).first << "\n";
  }



  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int dsu[1000001];
int prt(int n){
	if (dsu[n]==n) rt n;
	return dsu[n]=prt(dsu[n]);
}
void unn(int x,int y){
	if (prt(x)==prt(y)) rt;
	dsu[prt(x)]=dsu[prt(y)];
}
void solve(){
	int n,m;
	cin>>n>>m;
	for (int i=1; i<=n; i++) dsu[i]=i;
	int x,y;
	for (int i=0; i<m; i++){
		cin>>x>>y;
		unn(prt(x),prt(y));
	}
	map <int,bool> p;
	int ans=0;
	for (int i=1; i<=n; i++){
		if (!p[prt(i)]){
			p[prt(i)]=1;
			ans++;
		}
	}
	cout<<ans-1;
}
signed main(){
    solve();
}

Compiler output:
a.cc: In function 'int prt(int)':
a.cc:5:24: error: 'rt' was not declared in this scope; did you mean 'prt'?
    5 |         if (dsu[n]==n) rt n;
      |                        ^~
      |                        prt
a.cc: In function 'void unn(int, int)':
a.cc:9:29: error: 'rt' was not declared in this scope; did you mean 'prt'?
    9 |         if (prt(x)==prt(y)) rt;
      |                             ^~
      |                             prt
Language: C++

//Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <atcoder/all>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
template<class T>
void dmp(T a){
	rep(i,a.size()) cout << a[i] << " ";
	cout << endl;
}
template<class T>
bool chmax(T&a, T b){
	if(a < b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a, T b){
	if(a > b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}
//ios::sync_with_stdio(false);
const ll mod = 998244353;
template<class T>
void add(T&a,T b){
	a+=b;
	if(a >= mod) a-=mod;
}

ll modpow(ll x,ll n){
	ll res=1;
	while(n>0){
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
ll F[200005],R[200005],coef[200005];
void make(){
	F[0] = 1;
	for(int i=1;i<200005;i++) F[i] = F[i-1]*i%mod;
	for(int i=0;i<200005;i++) R[i] = modpow(F[i],mod-2);
	coef[0] = 1;
	for(int i=2;i<200005;i+=2){
		coef[i] = coef[i-2] * i % mod * (i-1) % mod * R[2] % mod;
	}
	for(int i=0;i<200005;i++) coef[i] = coef[i] * R[i/2] % mod;
}
ll C(int a,int b){
	return F[a]*R[b]%mod*R[a-b]%mod;
}
int n, h[100005];

struct S{
	vector<int>vec;
	bool operator < (const S & a) const{
		return vec.size() > a.vec.size();
	}
};
int main(){
	make();
	cin >> n;
	repn(i, 2*n){
		int a; cin >> a; h[a] ++;
	}
	queue<S>que;
	rep(i, 100005){
		vector<int>vec({1});
		ll cur = 1;
		for(int j=1;j*2<=h[i];j++){
			cur = cur * (h[i]+2-j*2) % mod * (h[i]+1-j*2) % mod * R[2] % mod;
			vec.pb((int)(cur * R[j] % mod));
		}
		que.push(S{vec});
	}
	while(que.size() >= 2){
		auto a = que.front(); que.pop();
		auto b = que.front(); que.pop();
		
		auto c = convolution(a.vec, b.vec);
		que.push(S{c});
	}
	auto X = que.top().vec;
	ll ans = 0;
	for(int i=0;i<X.size();i++){
		if(i%2==0) ans += 1LL * X[i] * coef[2*n-i*2] % mod;
		else ans -= 1LL * X[i] * coef[2*n-i*2] % mod;
	}
	cout << (ans%mod+mod)%mod << '\n';
}

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

//Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <atcoder/all>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
template<class T>
void dmp(T a){
	rep(i,a.size()) cout << a[i] << " ";
	cout << endl;
}
template<class T>
bool chmax(T&a, T b){
	if(a < b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a, T b){
	if(a > b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}
//ios::sync_with_stdio(false);
const ll mod = 998244353;
template<class T>
void add(T&a,T b){
	a+=b;
	if(a >= mod) a-=mod;
}

ll modpow(ll x,ll n){
	ll res=1;
	while(n>0){
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
ll F[200005],R[200005],coef[200005];
void make(){
	F[0] = 1;
	for(int i=1;i<200005;i++) F[i] = F[i-1]*i%mod;
	for(int i=0;i<200005;i++) R[i] = modpow(F[i],mod-2);
	coef[0] = 1;
	for(int i=2;i<200005;i+=2){
		coef[i] = coef[i-2] * i % mod * (i-1) % mod * R[2] % mod;
	}
	for(int i=0;i<200005;i++) coef[i] = coef[i] * R[i/2] % mod;
}
ll C(int a,int b){
	return F[a]*R[b]%mod*R[a-b]%mod;
}
int n, h[100005];

struct S{
	vector<int>vec;
	bool operator < (const S & a) const{
		return vec.size() > a.vec.size();
	}
};
int main(){
	make();
	cin >> n;
	repn(i, 2*n){
		int a; cin >> a; h[a] ++;
	}
	priority_queue<S>que;
	rep(i, 100005){
		if(h[i] < 2) continue;
		vector<int>vec({1});
		ll cur = 1;
		for(int j=1;j*2<=h[i];j++){
			cur = cur * (h[i]+2-j*2) % mod * (h[i]+1-j*2) % mod * R[2] % mod;
			vec.pb((int)(cur * R[j] % mod));
		}
		que.push(S{vec});
	}
	while(que.size() >= 2){
		auto a = que.top(); que.pop();
		auto b = que.top(); que.pop();
		
		auto c = convolution(a.vec, b.vec);
		que.push(S{c});
	}
	auto X = que.top().vec;
	ll ans = 0;
	for(int i=0;i<X.size();i++){
		if(i%2==0) ans += 1LL * X[i] * coef[2*n-i*2] % mod;
		else ans -= 1LL * X[i] * coef[2*n-i*2] % mod;
	}
	cout << (ans%mod+mod)%mod << '\n';
}

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

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#include <atcoder/all>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define endl '\n'
#define debug(x) std::cerr << #x << " = " << (x) << endl;

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

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

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

using mint = atcoder::modint998244353;

ll N;
ll h[100010];
mint fact[100010], inv[100010], dfact[100010];
std::map<ll, ll> cnt;

int main() {
  std::cin >> N;

  rep( i, 2*N ) {
    std::cin >> h[i];

    ++cnt[h[i]];
  }

  std::vector<ll> fs;
  
  for( auto m : cnt )
    fs.emplace_back( m.second );

  ll M = fs.size();

  fact[0] = mint(1);
  rep( i, 2*N )
    fact[i+1] = fact[i]*(i+1);

  inv[N] = fact[N].inv();
  repd( i, N )
    inv[i] = inv[i+1]*(i+1);

  // dfact[i] = (2*i-1)!!
  dfact[0] = mint(1);
  rep( i, N )
    dfact[i+1] = dfact[i]*(2*i+1);

  std::vector<std::vector<mint>> d( M );

  rep( i, M ) {
    ll k = fs[i]/2;

    rep( j, k+1 )
      d[i].emplace_back( fact[fs[i]]*inv[2*j]*inv[fs[i]-2*j]*dfact[j] );
  }

  while( d.size() != 1 ) {
    auto pd = d;

    d = std::vector<std::vector<mint>>();

    rep( i, pd.size() ) {
      auto a = pd[i];

      if( i == pd.size()-1 ) {
        d.emplace_back( a );

        break;
      }

      auto b = pd[++i];

      d.emplace_back( atcoder::convolution(a,b) );
    }
  }

  mint ans = 0;

  rep( i, d[0].size() ) {
    ans += d[0][i]*(i&1 ? -1 : 1)*dfact[N-i];
  }

  std::cout << ans.val() << endl;

  return 0;
}

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

#include<atcoder/all>
#include<bits/stdc++.h>
using namespace std;
using namespace atcoder;
const int MOD = 998244353;
void plusle(int &a, int b) {
    a += b;
    while (a >= MOD) a -= MOD;
}
void minun(int &a, int b) {
    a -= b;
    while (a < 0) a += MOD;
}
int add(int a, int b) {
    a += b;
    while (a >= MOD) a -= MOD;
    return a;
}
int sub(int a, int b) {
    a -= b;
    while (a < 0) a += MOD;
    return a;
}
int mul(int a, int b) {
    return int64_t(a) * b % MOD;
}
int power(int a, int64_t b) {
    int res = 1;
    for (; b > 0 ; b >>= 1, a = mul(a, a))
        if (b & 1) res = mul(res, a);
    return res;
}

const int MX = 2e5 + 10;
int fac[MX], invf[MX] ;
void prefact() {
    fac[0] = 1 ;
    for (int i = 1 ; i < MX ; i ++) {
        fac[i] = mul(fac[i - 1], i);
    }
    invf[MX - 1] = power (fac[MX - 1], MOD - 2);
    for (int i = MX - 2 ; i >= 0 ; i --) {
        invf[i] = mul(invf[i + 1], i + 1);
    }
}
int ncr(int N, int R) {
    if (R > N) return 0;
    if (R == 0 || R == N) return 1;
    return mul(fac[N], mul(invf[N - R], invf[R]));
}
const int nax = 2e5 + 10;


int h[nax];
int n;
int cnt[nax];

multiset < pair <int, vector <int>>> setik;

int main() {
    prefact();
    scanf("%d", &n);
    for (int i = 1 ; i <= 2 * n ; ++ i) {
        scanf("%d", h + i);
        cnt[h[i]] += 1;
    }

    for (int i = 1 ; i <= 100000 ; ++ i) {
        if (cnt[i] <= 1) continue;
        vector <int> foo(cnt[i] / 2 + 1);

        for (int j = 0 ; j < foo.size() ; ++ j) {
            foo[j] = ncr(cnt[i], j * 2);
        }
        setik.emplace(foo.size(), foo);
    }

    while (setik.size() >= 2) {
        vector <int> p1 = setik.begin()->second;
        setik.erase(setik.begin());
        vector <int> p2 = setik.begin()->second;
        setik.erase(setik.begin());
        p1 = convolution(p1, p2);
        setik.emplace(p1.size(), p1);
    }

    vector <int> c = setik.empty() ? vector<int>() : setik.begin()->second;

    if (c.size() <= n) c.resize(n + 2);




    const int INV2 = (MOD + 1) / 2;

    int ans = 0;
    for (int bar = 0 ; bar <= n ; ++ bar) {
        int v = 1;
        int res = 2 * n - bar * 2;
        v = mul(v, fac[res]);
        v = mul(v, invf[res / 2]);
        v = mul(v, power(INV2, res / 2));
        v = mul(v, c[bar]);
        if (bar % 2 == 0) plusle(ans, v);
        else minun(ans, v);
    }

    printf("%d\n", ans);

    /**
    f(i) the number of ways to get
    i equal pairs from first v group
    */



}


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

//This Code was made by Chinese_zjc_.
#include <iostream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <set>
#include <ctime>
#include <atcoder/all>
#define int long long
#define double long double
using namespace std;
const double PI = acos(-1);
const double eps = 0.0000000001;
const int INF = 0x3fffffffffffffff;
const int MOD = 998244353;
stack<vector<int>> ans;
vector<int> tmp;
int n, h, sum[100005], F[100005], Finv[100005], G[100005], ANS;
int C(int M, int N)
{
    return F[M] * Finv[N] % MOD * Finv[M - N] % MOD;
}
int power(int A, int B)
{
    int res = 1;
    while (B)
    {
        if (B & 1)
        {
            res = res * A % MOD;
        }
        A = A * A % MOD;
        B >>= 1;
    }
    return res;
}
signed main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    for (int i = 1; i <= n << 1; ++i)
    {
        cin >> h;
        ++sum[h];
    }
    F[0] = 1;
    for (int i = 1; i <= 100000; ++i)
    {
        F[i] = F[i - 1] * i % MOD;
    }
    Finv[100000] = power(F[100000], MOD - 2);
    for (int i = 100000; i; --i)
    {
        Finv[i - 1] = Finv[i] * i % MOD;
    }
    G[0] = 1;
    for (int i = 1; i <= 100000; ++i)
    {
        G[i] = G[i - 1] * (i + i - 1) % MOD;
    }
    for (int i = 1; i <= 100000; ++i)
    {
        if (sum[i])
        {
            tmp.clear();
            for (int j = 0; j <= sum[i] >> 1; ++j)
            {
                int v = C(sum[i], j << 1) * G[j] % MOD;
                if (j & 1)
                {
                    v = MOD - v;
                }
                tmp.push_back(v);
            }
            ans.push(tmp);
        }
    }
    while ((int)ans.size() > 1)
    {
        tmp = ans.top();
        ans.pop();
        tmp = atcoder::convolution(tmp, ans.top());
        ans.pop();
        ans.push(tmp);
    }
    tmp = ans.top();
    ans.pop();
    for (int i = 0; i < tmp.size(); ++i)
    {
        ANS = (ANS + tmp[i] * G[n - i]) % MOD;
    }
    cout << ANS << endl;
    return 0;
}

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

#include <bits/stdc++.h>
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;

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; }

#include <atcoder/modint>
#include <atcoder/convolution>
using modint = atcoder::modint998244353;

int N;
vector<int> H;
inline void input(){
    fast_io();
    cin >> N;
    H = fetch_vec<int>(2*N);
}

int solve(){
    vector<modint> fact(2*N+1), revfact(2*N+1), odd_fact(2*N+1);
    fact[0] = fact[1] = 1;
    for (int i = 0; i < 2*N; i++) fact[i+1] = fact[i]*(i+1);
    revfact[2*N] = fact[2*N].inv();
    for (int i = 2*N-1; i >= 0; i--) revfact[i] = revfact[i+1]*(i+1);
    // odd_fact[i] = (2*i-1)!!
    odd_fact[0] = 1;
    for (int i = 0; i < 2*N; i++) odd_fact[i+1] = odd_fact[i]*(2*i+1);
    auto combi = [&](int n, int k){ return fact[n]*revfact[n-k]*revfact[k];};
    // modint ans = fact[2*N]*revfact[N]*modint(2).pow(N).inv();
    map<int, int> cnt;
    for(auto h:H) cnt[h]++;
    vector<ll> nums;
    for(auto [h,c]:cnt) nums.emplace_back(c);
    int K = nums.size();
    sort(nums.begin(),nums.end());
    deque<vector<modint> > q;
    for (int k = 0; k < K; k++)
    {
        ll n = nums[k];
        vector<modint> tmp;
        for (int i = 0; 2*i <= n; i++)
        {
            // tmp.push_back(fact[n]*revfact[i]*revfact[n-2*i]*modint(2).pow(i).inv());
            tmp.push_back(combi(n,2*i)*odd_fact[i]);
        }
        q.push_back(tmp);
    }
    auto cmp = [](vector<modint> a, vector<modint> b){return a.size() < b.size();};
    sort(q.begin(), q.end(), cmp);

    while(q.size()>1){
        vector<modint> c = atcoder::convolution(q[0], q[1]);
        q.push_back(c);
        q.pop_front();
        q.pop_front();
    }
    
    vector<modint> pair_coff = q.front();
    modint ans = 0;
    // 同じグループ内のペアを少なくともk個つくる、でほう助原理をつかう。
    for (int k = 0; k < (int)pair_coff.size(); k++)
    {
        modint ans_k = pair_coff[k]*odd_fact[N-k];
        if(k%2) ans -= ans_k;
        else ans += ans_k;
    }
    cout << ans.val() << "\n";
    return 0;
}   

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


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

#include<bits/stdc++.h>

using namespace std;

#define FOR(i, x, y) for(int i = (x); i < (y); ++i)
#define REP(i, x, y) for(int i = (x); i <= (y); ++i)
#define PB push_back
#define MP make_pair
#define PH push
#define fst first
#define snd second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;

const int maxn = 131072;
const int maxh = 1e5 + 5;
const int INF = 998244353;
const int G = 3;

int n, ans;
int cnt[maxh], fac[maxn], ifac[maxn], g[maxn];
vector<int> a, f;

inline  qpow(ll x, ll y){
	ll ret = 1;
	for(; y; y >>= 1){
		if(y & 1)
			(ret *= x) %= INF;
		(x *= x) %= INF;
	}
	return ret;
}

inline int C(int x, int y){ return 1ll * fac[x] * ifac[y] % INF * ifac[x - y] % INF; }

inline void fft(vector<int> &coe, int siz, int IDFT){
	for(; coe.size() < siz; coe.PB(0));
	for(int i = 0, j = 0; i < siz; ++i){
		if(i < j)
			swap(coe[i], coe[j]);
		for(int l = siz >> 1; (j ^= l) < l; l >>= 1);
	} 
	for(int step = 1; step < siz; step <<= 1){
		ll w;
		if(~IDFT)
			w = qpow(G, (INF - 1) / (step << 1));
		else
			w = qpow(G, INF - 1 - (INF - 1) / (step << 1));
		for(int i = 0; i < siz; i += step << 1){
			ll cur = 1;
			FOR(j, 0, step){
				int x = coe[i + j], y = 1ll * cur * coe[i + j + step] % INF;
				coe[i + j] = (x + y) % INF;
				coe[i + j + step] = (x - y + INF) % INF;
				(cur *= w) %= INF; 
			}
		}
	}
	if(!~IDFT){
		int inv = qpow(siz, INF - 2);
		FOR(i, 0, siz)
			coe[i] = 1ll * coe[i] * inv % INF;
	}
	return;
}

inline vector<int> mul(vector<int> a, vector<int> b){
	int siz = 1;
	for(; siz < a.size() + b.size(); siz <<= 1);
	fft(a, siz, 1);
	fft(b, siz, 1);
	vector<int> c;
	c.resize(siz);
	FOR(i, 0, siz)
		c[i] = 1ll * a[i] * b[i] % INF;
	fft(c, siz, -1);
//	FOR(i, 0, c.size())
//		printf("%d ", c[i]);
//	puts("");
	return c;
}

inline vector<int> solve(int l, int r){
	vector<int> ret; ret.PB(1);
	if(l == r){
   		REP(i, 1, a[l] / 2)
			ret.PB(1ll * C(a[l], i * 2) * g[i * 2]);
//		FOR(i, 0, ret.size())
//			printf("%d ", ret[i]);
//		puts(""); 
		return ret;
	}
	int md = l + r >> 1;
//	printf("l = %d r = %d\n", l, r);
	return mul(solve(l, md), solve(md + 1, r));
}

inline void precalc(){
	g[0] = 1;
	for(int i = 2; i < maxn; i += 2)
		g[i] = 1ll * g[i - 2] * (i - 1) % INF;
	fac[0] = 1;
	FOR(i, 1, maxn)
		fac[i] = 1ll * fac[i - 1] * i % INF;
	ifac[maxn - 1] = qpow(fac[maxn - 1], INF - 2);
	for(int i = maxn - 2; i >= 0; --i)
		ifac[i] = 1ll * ifac[i + 1] * (i + 1) % INF;
	return;
}

int main(){
	precalc();
	scanf("%d", &n);
	FOR(i, 0, n * 2){
		int x; scanf("%d", &x);
		++cnt[x];
	} 
	REP(i, 1, 100000) if(cnt[i])
		a.PB(cnt[i]);
	f = solve(0, a.size() - 1);
	REP(i, 1, n){
		int res = 1ll * f[i] * g[n * 2 - i * 2] % INF;
		if(i & 1)
			(ans += res) %= INF;
		else
			((ans -= res) += INF) %= INF;
	}
	
	ans = INF - ans;
	(ans += g[n * 2]) %= INF;
	printf("%d\n", ans);
	return 0;
}


Compiler output:
a.cc:27:9: error: ISO C++ forbids declaration of 'qpow' with no type [-fpermissive]
   27 | inline  qpow(ll x, ll y){
      |         ^~~~
Language: C++

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"
#include "atcoder/all"

using namespace std;
using namespace atcoder;

//constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-5;

//int N, M, K, T, H, W, L, R;
long long int N, M, K, T, H, W, L, R;

long long int power(long long int x, long long int n, long long int M) {
	long long int ret = 1;
	long long int by = x;
	while (n) {
		if (n & 1) {
			ret *= by;
			ret %= M;
		}
		by *= by;
		by %= M;
		n >>= 1;
	}
	return ret;
}

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

	cin >> N;
	vector<int>num(100001);
	for (int i = 0; i < 2 * N; i++) {
		cin >> M;
		num[M]++;
	}
	vector<vector<long long int>>box(100001);
	vector<long long int>by(200001, 1);
	vector<long long int>rev(200001, 1);
	for (int i = 1; i <= 200000; i++) {
		by[i] = by[i - 1] * i%MOD;
		rev[i] = power(by[i], MOD - 2, MOD);
	}
	priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>>PQ;
	for (int i = 1; i <= 100000; i++) {
		if (num[i] / 2 == 0)continue;
		vector<int>v(num[i] / 2 + 1, 1);
		for (int j = 1; j <= num[i] / 2; j++) {
			v[j] = by[num[i]] * rev[num[i] - 2 * j] % MOD*rev[j] % MOD*rev[2] % MOD;
		}
		box[i] = v;
		PQ.push({ num[i] / 2,i });
	}
	if (PQ.empty()) {
		cout << by[N * 2] % MOD*rev[N] % MOD*power(rev[2], N, MOD) % MOD << endl;
		return 0;
	}
	while (PQ.size() > 1) {
		auto a = PQ.top();
		PQ.pop();
		auto b = PQ.top();
		PQ.pop();
		box[a.second] = convolution(box[b.second], box[a.second]);
		box[b.second].clear();
		PQ.push({ box[a.second].size() - 1,a.second });
	}
	long long int ans = 0;
	for (int i = 0; i <= PQ.top().first; i++) {
		if (i & 1) {
			ans += MOD - box[PQ.top().second][i] * by[N * 2 - i * 2] % MOD*rev[N - i] % MOD*power(rev[2], N - i, MOD) % MOD;
		}
		else {
			ans += box[PQ.top().second][i] * by[N * 2 - i * 2] % MOD*rev[N - i] % MOD*power(rev[2], N - i, MOD) % MOD;
		}
	}
	cout << ans % MOD << endl;
}

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

#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace atcoder;
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll
const long double pi = 3.14159265358979323846;

using mint = modint998244353;
string to_string(mint &m) {
    return to_string(m.val());
}
string to_string(vector<mint> &v) {
    string res = "{";
    ll n = v.size();
    for (int i = 0; i < n; i++) {
        res += to_string(v[i]) + " ";
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char *c) {return to_string((string) c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

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

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    vector<ll> cnt(n_max);
    rep(i,0,n * 2){
        ll h; cin >> h;
        cnt[h]++;
    }

    queue<vector<mint>> que;

    rep(i,0,n_max){
        if(cnt[i]){
            debug(i, cnt[i]);
            que.emplace(vector<mint>{1, -cnt[i] * (cnt[i] - 1) / 2});
        }
    }

    while(que.size() > 1){
        auto a = que.front();
        que.pop();
        auto b = que.front();
        que.pop();
        auto c = convolution(a, b);
        que.emplace(c);
        debug(a, b, c);
    }

    vector<mint> c = que.front();
    debug(c);
    mint ans = 0;
    mint base = 1;
    rep(i, 0, n) base *= (2 * i + 1);
    mint tmp = 2 * n - 1;
    ll m = c.size();
    rep(i,0,m){
        ans += c[i] * base;
        base /= tmp;
        tmp -= 2;
    }

    cout << ans.val() << endl;
}

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