buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; typedef long long ll; static const ll MOD = 998244353; static const int MAX = 100000; ll fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; static const ll MOD = 998244353; static const int MAX = 500000 + 100; ll fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MO...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13]]
1
353
#include <bits/stdc++.h> using namespace std; #define int long long #define endl "\n" #define pii pair<int, int> #define vi vector<int> #define sz(x) (int)x.size() #define dint long double ////////////////////////////////////////////////////////////////////// const int mod = 998244353; const int MX = 5e5 + 5; int mo...
#include <bits/stdc++.h> using namespace std; #define int long long #define endl "\n" #define pii pair<int, int> #define vi vector<int> #define sz(x) (int)x.size() #define dint long double ////////////////////////////////////////////////////////////////////// const int mod = 998244353; const int MX = 5e5 + 5; int mo...
[["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 25]]
1
701
#ifdef MY_LOCAL #define MY_NAMESPACE(ns) namespace ns { #define MY_NAMESPACE_ } #define MY_DEBUG(s) s #else #define MY_NAMESPACE(ns) #define MY_NAMESPACE_ #define MY_DEBUG(s) #endif #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <...
#ifdef MY_LOCAL #define MY_NAMESPACE(ns) namespace ns { #define MY_NAMESPACE_ } #define MY_DEBUG(s) s #else #define MY_NAMESPACE(ns) #define MY_NAMESPACE_ #define MY_DEBUG(s) #endif #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["-", 12, 23, 0, 16, 31, 16, 31, 69, 28, 22], ["+", 12, 23, 0, 16, 31, 16, 31, 69, 28, 22]]
1
549
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define pb push_back using namespace std; typedef long long ll; const ll mod = 998244353; struct mint { ll x; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { if (...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define pb push_back using namespace std; typedef long long ll; const ll mod = 998244353; struct mint { ll x; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { if (...
[["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 33], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13]]
1
461
#include <iostream> using namespace std; const int mod = 998244353; const int MAX = 100005; long long fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % mod; inv[i] = mod - inv[mod % i] * (...
#include <iostream> using namespace std; const int mod = 998244353; const int MAX = 200005; long long fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % mod; inv[i] = mod - inv[mod % i] * (...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
415
#include "bits/stdc++.h" using namespace std; int64_t M = 998244353; vector<int64_t> fac(100001); // n! (mod M) vector<int64_t> ifac(100001); // k!^{M-2} (mod M) int64_t mpow(int64_t x, int64_t n) { int64_t ans = 1; while (n != 0) { if (n & 1) { ans = ans * x % M; } x = x * x % M; n = n >> ...
#include "bits/stdc++.h" using namespace std; int64_t M = 998244353; vector<int64_t> fac(200001); // n! (mod M) vector<int64_t> ifac(200001); // k!^{M-2} (mod M) int64_t mpow(int64_t x, int64_t n) { int64_t ans = 1; while (n != 0) { if (n & 1) { ans = ans * x % M; } x = x * x % M; n = n >> ...
[["-", 0, 30, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 4, 0, 13]]
1
349
/* * Language: C++ * Author: Debajyoti Dasgupta */ #include <bits/stdc++.h> using namespace std; #define int long long const int mod = 998244353; const int maxx = 2e5 + 10; vector<int> fact(maxx); int power(int x, int y) { int res = 1; while (y) { if (y & 1) res = (res * x) % mod; x = (...
/* * Language: C++ * Author: Debajyoti Dasgupta */ #include <bits/stdc++.h> using namespace std; #define int long long const int mod = 998244353; const int maxx = 2e5 + 10; vector<int> fact(maxx); int power(int x, int y) { int res = 1; while (y) { if (y & 1) res = (res * x) % mod; x = (...
[["+", 0, 37, 0, 16, 31, 16, 12, 2, 63, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25]]
1
277
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long LL; typedef long double LD; const int mod = 1000000007; struct mint { LL x; mint(LL x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long LL; typedef long double LD; const int mod = 998244353; struct mint { LL x; mint(LL x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { ...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
627
M = 998244353 n,m,K = map(int,input().split()) ans = 0 c = 1 for k in range(K+1): ans += c * m * pow(m-1,n-k-1,M) c *= (n-k+1) * pow(k+1,M-2,M) ans %= M c %= M print(ans)
M = 998244353 n,m,K = map(int,input().split()) ans = 0 c = 1 for k in range(K+1): ans += c * m * pow(m-1,n-k-1,M) c *= (n-k-1) * pow(k+1,M-2,M) ans %= M c %= M print(ans)
[["-", 0, 677, 12, 657, 31, 23, 0, 657, 17, 72], ["+", 0, 677, 12, 657, 31, 23, 0, 657, 17, 33]]
5
89
#atcoder template def main(): import sys imput = sys.stdin.readline #ここにコード #input N, M, K = map(int, input().split()) #output mod = 998244353 n_ = 4*10**5 + 5 fun = [1]*(n_+1) for i in range(1,n_+1): fun[i] = fun[i-1]*i%mod rev = [1]*(n_+1) rev[n_] = pow(fun[n_...
#atcoder template def main(): import sys imput = sys.stdin.readline #ここにコード #input N, M, K = map(int, input().split()) #output mod = 998244353 n_ = 4*10**5 + 5 fun = [1]*(n_+1) for i in range(1,n_+1): fun[i] = fun[i-1]*i%mod rev = [1]*(n_+1) rev[n_] = pow(fun[n_...
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 14, 8, 196, 0, 57, 75, 76, 0, 95], ["-", 0, 14, 8, 196, 0, 57, 75, 76, 0, 102], ["-", 0, 57, 75, 76, 8, 196, 0, 116, 0, 117], ["+", 6...
5
265
#include <bits/stdc++.h> #define endl "\n" using namespace std; typedef long long int lli; const lli M = 998244353, N = 1e5 + 5; lli fact[N]; lli binpow(lli a, lli b) { if (b == 0) return 1; lli res = binpow(a, b / 2); res = (res * res) % M; if (b % 2) return (res * a) % M; return res; } lli inv(ll...
#include <bits/stdc++.h> #define endl "\n" using namespace std; typedef long long int lli; const lli M = 998244353, N = 2e5 + 5; lli fact[N]; lli binpow(lli a, lli b) { if (b == 0) return 1; lli res = binpow(a, b / 2); res = (res * res) % M; if (b % 2) return (res * a) % M; return res; } lli inv(ll...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13]]
1
406
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define repr(i, n) for (int i = (int)n - 1; i >= 0; --i) #define ALL(a) (a).begin(), (a).end() using ll = long long; // using Graph = vector<vector<int>>; const ll...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define repr(i, n) for (int i = (int)n - 1; i >= 0; --i) #define ALL(a) (a).begin(), (a).end() using ll = long long; // using Graph = vector<vector<int>>; const ll...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["-", 0, 30, 0, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
680
#include <bits/stdc++.h> using namespace std; // 型定義 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 int MOD = 998244353; const ll LINF = 1e18; // グラフ表現 using Graph = vector<vector<int>>; // グラフの...
#include <bits/stdc++.h> using namespace std; // 型定義 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 int MOD = 998244353; const ll LINF = 1e18; // グラフ表現 using Graph = vector<vector<int>>; // グラフの...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
544
from operator import mul from functools import reduce from math import gcd import math import bisect import itertools import sys sys.setrecursionlimit(10**7) input = sys.stdin.readline INF = float("inf") MOD = 998244353 class Combination(object): def __init__(self, N, MOD): self.fac = [0] * (N + 1) self.inv = [0]...
from operator import mul from functools import reduce from math import gcd import math import bisect import itertools import sys sys.setrecursionlimit(10**7) input = sys.stdin.readline INF = float("inf") MOD = 998244353 class Combination(object): def __init__(self, N, MOD): self.fac = [0] * (N + 1) self.inv = [0]...
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
368
#include <iostream> #include <vector> uint32_t pow_mod(uint32_t base, uint32_t exp, uint32_t mod) { if (exp == 1) return base % mod; uint64_t half = pow_mod(base, exp / 2, mod); uint64_t ans = (half * half) % mod; return (ans * (exp % 2 == 0 ? 1ll : base)) % mod; } uint32_t inv_mod(uint32_t x, uint32_t m...
#include <iostream> #include <vector> uint32_t pow_mod(uint32_t base, uint32_t exp, uint32_t mod) { if (exp == 0) return 1; uint64_t half = pow_mod(base, exp / 2, mod); uint64_t ans = (half * half) % mod; return (ans * (exp % 2 == 0 ? 1ll : base)) % mod; } uint32_t inv_mod(uint32_t x, uint32_t mod) { ret...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 8, 9, 0, 57, 64, 37, 0, 16, 31, 22], ["-", 8, 9, 0, 57, 64, 37, 0, 16, 17, 109], ["-", 8, 9, 0, 57, 64, 37, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 13]]
1
340
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast") #pragma GCC target("avx") #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int(i) = 0; i < (n); i++) #define REP(i, m, n) for (int(i) = (m); (i) < (n); (i)++) #define MOD 1000000007 #define fcout cout << fixed << setprecision(15) #d...
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast") #pragma GCC target("avx") #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int(i) = 0; i < (n); i++) #define REP(i, m, n) for (int(i) = (m); (i) < (n); (i)++) #define MOD 998244353 #define fcout cout << fixed << setprecision(15) #de...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 0, 1, 0, 34, 31, 11, 12, 16, 17, 109], ["+", 0, 1, 0, 34, 31, 11, 12, 16, 12, 22]]
1
567
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e6 + 9, mod = 99824353; int n, m, k, ans, fact[N], inv[N]; int qp(int a, int b = mod - 2) { return (b == 0 ? 1 : (b % 2 ? qp(a * a % mod, b / 2) * a % mod : qp(a * a % mod, b / 2))); } int C(i...
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e6 + 9, mod = 998244353; int n, m, k, ans, fact[N], inv[N]; int qp(int a, int b = mod - 2) { return (b == 0 ? 1 : (b % 2 ? qp(a * a % mod, b / 2) * a % mod : qp(a * a % mod, b / 2))); } int C(...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
303
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INX(x) (cin >> x) #define OUTX(x) (cout << x << endl) #define ADD emplace_back #define MP make_pair #define BASEP 998244353 ll powmod(ll x, ll pow, ll mod) { ll result = 1; while (pow > 0) { if (pow & 1) { result *= x; r...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INX(x) (cin >> x) #define OUTX(x) (cout << x << endl) #define ADD emplace_back #define MP make_pair #define BASEP 998244353 ll powmod(ll x, ll pow, ll mod) { ll result = 1; while (pow > 0) { if (pow & 1) { result *= x; r...
[["-", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["-", 8, 9, 0, 43, 39, 344, 3, 347, 0, 18], ["-", 8, 9, 0, 43, 39, 344, 3, 347, 0, 47], ["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 24], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 0, 70], ["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 25], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 0, 73]]
1
430
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; // auto mod int // https://youtu.be/L8grWxBlIZ4?t=9858 // https://youtu.be/ERZuLAxZffQ?t=4807 : optimize // https://youtu.be/8uowVvQ_-Mo?t=1329 : division const int mod = 998244...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; // auto mod int // https://youtu.be/L8grWxBlIZ4?t=9858 // https://youtu.be/ERZuLAxZffQ?t=4807 : optimize // https://youtu.be/8uowVvQ_-Mo?t=1329 : division const int mod = 998244...
[["-", 0, 14, 8, 9, 0, 7, 26, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 28, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22]]
1
649
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define sz(x) (int)x.size() #define all(x) begin(x), end(x) #define fi first #define se second #define debug(x) cerr << #x << " " << x << '\n' using namespace std; using ll = long long; using pii = pair<int, int>; using pli = pair<ll, int>; const int IN...
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define sz(x) (int)x.size() #define all(x) begin(x), end(x) #define fi first #define se second #define debug(x) cerr << #x << " " << x << '\n' using namespace std; using ll = long long; using pii = pair<int, int>; using pli = pair<ll, int>; const int IN...
[["-", 12, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 12, 22]]
1
416
#include <bits/stdc++.h> using namespace std; #define fastIO \ std::ios_base::sync_with_stdio(false); \ std::cin.tie(0); \ std::cout.tie(0) #define rep(...
#include <bits/stdc++.h> using namespace std; #define fastIO \ std::ios_base::sync_with_stdio(false); \ std::cin.tie(0); \ std::cout.tie(0) #define rep(...
[["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
459
mod= 998244353 n,m,k=map(int,input().split()) ans=0 cmb=1 for i in range(k+1): ans+=cmb*m*pow(m-1,n-1-i,mod) ans%=mod X=(n-1-i)*pow(i+1,mod-2,mod) X%=mod print(ans)
mod= 998244353 n,m,k=map(int,input().split()) ans=0 cmb=1 for i in range(k+1): ans+=cmb*m*pow(m-1,n-1-i,mod) ans%=mod cmb*=(n-1-i)*pow(i+1,mod-2,mod) cmb%=mod print(ans)
[["-", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 108], ["-", 0, 7, 8, 196, 0, 1, 0, 677, 31, 22]]
5
89
#include <bits/stdc++.h> #define REP(i, m, n) for (int(i) = (m); (i) < (n); ++i) #define rep(i, n) REP(i, 0, n) #define all(x) (x).begin(), (x).end() using namespace std; using Graph = vector<vector<int>>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }...
#include <bits/stdc++.h> #define REP(i, m, n) for (int(i) = (m); (i) < (n); ++i) #define rep(i, n) REP(i, 0, n) #define all(x) (x).begin(), (x).end() using namespace std; using Graph = vector<vector<int>>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
1,030
#include <bits/stdc++.h> using namespace std; #define ll long long int #define LL_MAX LLONG_MAX #define ULL_MAX ULLONG_MAX #define ull unsigned long long #define IOS \ ios_base::sync_with_stdio(false); \ ci...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define LL_MAX LLONG_MAX #define ULL_MAX ULLONG_MAX #define ull unsigned long long #define IOS \ ios_base::sync_with_stdio(false); \ ci...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
378
from collections import Counter,defaultdict,deque from heapq import heappop,heappush,heapify from bisect import bisect_left,bisect_right import sys,math,itertools,fractions,pprint sys.setrecursionlimit(10**8) mod = 10**9+7 INF = float('inf') def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, ...
from collections import Counter,defaultdict,deque from heapq import heappop,heappush,heapify from bisect import bisect_left,bisect_right import sys,math,itertools,fractions,pprint sys.setrecursionlimit(10**8) mod = 10**9+7 INF = float('inf') def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, ...
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 612], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 612]]
5
394
def solve(): N,M,K = map(int,input().split()) MOD = 998244353 fac, finv, inv = COMinit(N,MOD) ans = 0 for i in range(K+1): ans += M % MOD * pow(M-1,N-1-i,MOD) % MOD * COM(N-1,i,MOD,fac,finv,inv) % MOD print(ans%MOD) # COMの前処理 # テーブルを作る # O(n) def COMinit(N, mod): fac = [0] * ...
def solve(): N,M,K = map(int,input().split()) MOD = 998244353 fac, finv, inv = COMinit(N+1,MOD) ans = 0 for i in range(K+1): ans += M % MOD * pow(M-1,N-1-i,MOD) % MOD * COM(N-1,i,MOD,fac,finv,inv) % MOD print(ans%MOD) # COMの前処理 # テーブルを作る # O(n) def COMinit(N, mod): fac = [0] ...
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
299
/* Isn't passion overrated?*/ #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define ll long long using namespace std; ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } ll mod = 998244353; ll power(ll a, ll x) { if (x == 0) return 1; ll ans = power(a, x / 2) % mod; ...
/* Isn't passion overrated?*/ #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define ll long long using namespace std; ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } ll mod = 998244353; ll power(ll a, ll x) { if (x == 0) return 1; ll ans = power(a, x / 2) % mod; ...
[["-", 0, 30, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 4, 0, 13]]
1
370
/* ___ |\ /| ____ ____ ____ ____ | | /\ / \ | | | \ / | /\ | \ | \ | | \ |_____| /__\ \____ |_____| | \/ | /__\ |____/ |____/ |__ |____/ | | / \ \ | | | | / \ | | | | \ ...
/* ___ |\ /| ____ ____ ____ ____ | | /\ / \ | | | \ / | /\ | \ | \ | | \ |_____| /__\ \____ |_____| | \/ | /__\ |____/ |____/ |__ |____/ | | / \ \ | | | | / \ | | | | \ ...
[["-", 81, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["-", 81, 2, 3, 4, 0, 16, 31, 16, 17, 48], ["-", 81, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["+", 49, 80, 81, 2, 3, 4, 0, 16, 31, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 13]]
1
556
N,M,K = map(int,input().split()) MOD = 998244353 mod = MOD MAX = N+1 fac = [0] * MAX finv = [0] * MAX inv = [0] * MAX def cominit(): fac[0] = 1 fac[1] = 1 finv[0] = 1 finv[1] = 1 inv[1] = 1 for i in range(2,MAX): fac[i] = fac[i-1] * i % mod inv[i] = mod - inv[mod%i] * (mod//i) ...
N,M,K = map(int,input().split()) MOD = 998244353 mod = MOD MAX = N+1 fac = [0] * MAX finv = [0] * MAX inv = [0] * MAX def cominit(): fac[0] = 1 fac[1] = 1 finv[0] = 1 finv[1] = 1 inv[1] = 1 for i in range(2,MAX): fac[i] = fac[i-1] * i % mod inv[i] = mod - inv[mod%i] * (mod//i) ...
[["+", 31, 657, 31, 652, 3, 4, 0, 657, 17, 33], ["+", 31, 657, 31, 652, 3, 4, 0, 657, 12, 612]]
5
263
#include <bits/stdc++.h> using namespace std; const int M = 998244353; const int MAX = 1e5 + 10; long long kai[MAX], kair[MAX], rev[MAX]; void com_p() { kai[0] = kai[1] = 1; kair[0] = kair[1] = 1; rev[1] = 1; for (int i = 2; i < MAX; i++) { kai[i] = kai[i - 1] * i % M; rev[i] = M - rev[M % i] * (M / ...
#include <bits/stdc++.h> using namespace std; const int M = 998244353; const int MAX = 1e5 * 2 + 5; long long kai[MAX], kair[MAX], rev[MAX]; void com_p() { kai[0] = kai[1] = 1; kair[0] = kair[1] = 1; rev[1] = 1; for (int i = 2; i < MAX; i++) { kai[i] = kai[i - 1] * i % M; rev[i] = M - rev[M % i] * (M...
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["-", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13]]
1
325
#include <bits/stdc++.h> using namespace std; #define int long long #define All(v) (v).begin(), (v).end() int dy[8] = {-1, 0, 1, 0, -1, 1, 1, -1}; int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const int mod = 998244353; const int inf = mod * mod; const int d5 = 100100; template <int mod> struct ModInt { int x; ModInt()...
#include <bits/stdc++.h> using namespace std; #define int long long #define All(v) (v).begin(), (v).end() int dy[8] = {-1, 0, 1, 0, -1, 1, 1, -1}; int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const int mod = 998244353; const int inf = mod * mod; const int d5 = 200100; template <int mod> struct ModInt { int x; ModInt()...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
968
//#include<bits/stdc++.h> #include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long...
//#include<bits/stdc++.h> #include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 49, 50, 51, 2, 3, 4, 0, 16, 12, 22], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]]
1
463
// by szh #include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define SZ(x) (int((x).size())) #define se second #define ll long long #define pq priority_queue #define MP make_pair #define pii pair<int, int> #define mod 998244353 #define inf 0x3f3f3f3f #define debug(x) cerr << #x << "=" ...
// by szh #include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define SZ(x) (int((x).size())) #define se second #define ll long long #define pq priority_queue #define MP make_pair #define pii pair<int, int> #define mod 998244353 #define inf 0x3f3f3f3f #define debug(x) cerr << #x << "=" ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13]]
1
336
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define DEBUG 1 using namespace std; constexpr int kMod = 998244353; typedef long lon...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define DEBUG 1 using namespace std; constexpr int kMod = 998244353; typedef long lon...
[["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78]]
1
583
#pragma region #pragma GCC target("avx2") #pragma GCC optimize("03") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; typedef unsigned long long ull; #define endl "\n" #define MP make_pair #define FOR(i, a, b) for (int i = (a); i <= (b); i+...
#pragma region #pragma GCC target("avx2") #pragma GCC optimize("03") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; typedef unsigned long long ull; #define endl "\n" #define MP make_pair #define FOR(i, a, b) for (int i = (a); i <= (b); i+...
[["-", 0, 30, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 4, 0, 13]]
1
853
#include <bits/stdc++.h> #include <bitset> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string> typedef long long ll; using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) const int mod = 1000000007; // const int mod = 998244353; struct mint { ll x; // typedef long long ll; ...
#include <bits/stdc++.h> #include <bitset> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string> typedef long long ll; using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) // const int mod = 1000000007; const int mod = 998244353; struct mint { ll x; // typedef long long ll; ...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
638
#include <bits/stdc++.h> using namespace std; typedef long long ll; using P = pair<int, int>; /* ちゃんと考えてわかって実装 */ const ll MOD = 998244353; // mod p における掛け算 ll mul_mod(ll a, ll b, ll modp) { return (a * b) % modp; } // mod p における累乗 ll mod_pow(ll x, ll n, ll modp) { ll res = 1; while (n > 0) { if (n & 1) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; using P = pair<int, int>; /* ちゃんと考えてわかって実装 */ const ll MOD = 998244353; // mod p における掛け算 ll mul_mod(ll a, ll b, ll modp) { return (a * b) % modp; } // mod p における累乗 ll mod_pow(ll x, ll n, ll modp) { ll res = 1; while (n > 0) { if (n & 1) ...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 0, 43, ...
1
418
def main(): N, M, K = map(int, input().split()) MOD = 998244353 fac = [0] * 10 ** 6 inv = [0] * 10 ** 6 finv = [0] * 10 ** 6 def COM_init(): fac[0] = 1 fac[1] = 1 inv[1] = 1 finv[0] = 1 finv[1] = 1 for i in range(2, 10**5+10): fac[i]...
def main(): N, M, K = map(int, input().split()) MOD = 998244353 fac = [0] * 10 ** 6 inv = [0] * 10 ** 6 finv = [0] * 10 ** 6 def COM_init(): fac[0] = 1 fac[1] = 1 inv[1] = 1 finv[0] = 1 finv[1] = 1 for i in range(2, 2 * 10**5 +10): f...
[["+", 12, 652, 3, 4, 0, 657, 31, 657, 31, 612], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 17, 48]]
5
264
N, M, K = list(map(int,input().split())) m = 998244353 # コンビネーション _{N} C_n (n=1,...,N)をmod mで計算する # フェルマーの小定理を利用する # 計算量はO(max(N,m)) class combination_mod: # mod mのもとでのN C nを計算するクラス,計算量はO(N) def __init__(self,N,m): self.N = N self.m = m self.N_factorials = [1 for _ in range(N)] # 1!からN!までをm...
N, M, K = list(map(int,input().split())) m = 998244353 # コンビネーション _{N} C_n (n=1,...,N)をmod mで計算する # フェルマーの小定理を利用する # 計算量はO(max(N,m)) class combination_mod: # mod mのもとでのN C nを計算するクラス,計算量はO(N) def __init__(self,N,m): self.N = N self.m = m self.N_factorials = [1 for _ in range(N)] # 1!からN!までをm...
[["+", 0, 57, 15, 679, 12, 666, 0, 319, 500, 22], ["+", 0, 57, 15, 679, 12, 666, 0, 319, 0, 131], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
366
import java.util.*; public class Main { Scanner sc = new Scanner(System.in); final int MOD = 998244353; final int MAX = Integer.MAX_VALUE; final long LMAX = Long.MAX_VALUE; int len = (int)1e6 + 1; long[] fac, finv, inv; void doIt() { int N = sc.nextInt(); int M = sc.nextInt(); int K = sc.nex...
import java.util.*; public class Main { Scanner sc = new Scanner(System.in); final int MOD = 998244353; final int MAX = Integer.MAX_VALUE; final long LMAX = Long.MAX_VALUE; int len = (int)1e6 + 1; long[] fac, finv, inv; void doIt() { int N = sc.nextInt(); int M = sc.nextInt(); int K = sc.nex...
[["-", 8, 196, 0, 1, 0, 492, 3, 4, 0, 22], ["-", 0, 195, 54, 495, 0, 496, 39, 506, 0, 507], ["-", 8, 498, 0, 195, 54, 495, 0, 496, 141, 22]]
3
463
class Cmb: def __init__(self, N, mod=998244353): self.fact = [1,1] self.fact_inv = [1,1] self.inv = [0,1] """ 階乗を保存する配列を作成 """ for i in range(2, N+1): self.fact.append((self.fact[-1]*i) % mod) self.inv.append((-self.inv[mod%i] * (mod//i))%mod)...
class Cmb: def __init__(self, N, mod=998244353): self.fact = [1,1] self.fact_inv = [1,1] self.inv = [0,1] """ 階乗を保存する配列を作成 """ for i in range(2, N+1): self.fact.append((self.fact[-1]*i) % mod) self.inv.append((-self.inv[mod%i] * (mod//i))%mod)...
[["-", 54, 54, 0, 696, 51, 657, 31, 657, 31, 612], ["-", 54, 54, 0, 696, 51, 657, 31, 657, 17, 578], ["-", 54, 54, 0, 696, 51, 657, 31, 657, 12, 612], ["-", 0, 14, 54, 54, 0, 696, 51, 657, 17, 72], ["-", 0, 14, 54, 54, 0, 696, 51, 657, 12, 612], ["+", 8, 196, 0, 14, 54, 54, 0, 696, 51, 612]]
5
309
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define ll long long #define PB push_back #define POP pop_back() #define PII pair<int, int> #define FI first #define SE second #define ULL unsigned long long #define endl '\n' using namespace std; con...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define ll long long #define PB push_back #define POP pop_back() #define PII pair<int, int> #define FI first #define SE second #define ULL unsigned long long #define endl '\n' using namespace std; con...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
238
#include <stdint.h> // uint64_t #include <stdio.h> #include <stdlib.h> #include <string.h> #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) > (b) ? (b) : (a)) int get_int3(int *a1, int *a2, int *a3) { scanf("%d %d %d", a1, a2, a3); return 0; } #define NUM_MAX 100000 #define COLOR_MAX 100000 #defin...
#include <stdint.h> // uint64_t #include <stdio.h> #include <stdlib.h> #include <string.h> #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) > (b) ? (b) : (a)) int get_int3(int *a1, int *a2, int *a3) { scanf("%d %d %d", a1, a2, a3); return 0; } #define NUM_MAX 200000 #define COLOR_MAX 200000 #defin...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
0
533
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; typedef long double ld; int dx[] = {0, 1, 0, -1}; int dy[] = {1, 0, -1, 0}; #define INF 100000000 #define MAX 200001 #define MOD 998244...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; typedef long double ld; int dx[] = {0, 1, 0, -1}; int dy[] = {1, 0, -1, 0}; #define INF 100000000 #define MAX 200001 #define MOD 998244...
[["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 25], ["+", 49, 50, 51, 16, 31, 16, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 2, 3, 4, 0, 22], ["+", 12, 23, 0, 16, 31, 2, 3, 4, 0, 25], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 17, 109]]
1
431
// By Mohit Gupta #include <bits/stdc++.h> using namespace std; // DEBUG void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); } #define printint(v) copy(begin(v), end(v), ostream_iterator<int>(cout, " ")) #def...
// By Mohit Gupta #include <bits/stdc++.h> using namespace std; // DEBUG void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); } #define printint(v) copy(begin(v), end(v), ostream_iterator<int>(cout, " ")) #def...
[["+", 3, 4, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73]]
1
618
#define _CRT_SECURE_NO_WARNINGS #pragma warning(disable : 4244) // 最悪をします #include <algorithm> #include <assert.h> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include...
#define _CRT_SECURE_NO_WARNINGS #pragma warning(disable : 4244) // 最悪をします #include <algorithm> #include <assert.h> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include...
[["+", 75, 76, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 75, 76, 0, 57, 64, 9, 0, 37, 0, 35]]
1
10,594
#include <bits/stdc++.h> using namespace std; // constexpr long MOD = 1000000007; constexpr long MOD = 998244353; vector<long> fact, inv; long mpow(long a, long b) { long res = 1; while (b > 0) { if (b & 1) res = res * a % MOD; a = a * a % MOD; b /= 2; } return res; } long com(long n, long ...
#include <bits/stdc++.h> using namespace std; // constexpr int MOD = 1000000007; constexpr int MOD = 998244353; vector<long> fact, inv; long mpow(long a, long b) { long res = 1; while (b > 0) { if (b & 1) res = res * a % MOD; a = a * a % MOD; b /= 2; } return res; } long com(long n, long r)...
[["-", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
390
n, m, k = map(int, input().split()) mod = 998244353 def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod N = 10**5 g1 = [1, 1] # 元テーブル g2 = [1, 1] #逆元テーブル inverse = [0, 1] #逆元テーブル計算用テーブル for i in range( 2, N + 1 ): g1.append( ( g1[-1] * i ) % m...
n, m, k = map(int, input().split()) mod = 998244353 def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod N = 10**6 g1 = [1, 1] # 元テーブル g2 = [1, 1] #逆元テーブル inverse = [0, 1] #逆元テーブル計算用テーブル for i in range( 2, N + 1 ): g1.append( ( g1[-1] * i )...
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
226
#include <algorithm> #include <cassert> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> P; // const ll mod = 1e9 + 7; const l...
#include <algorithm> #include <cassert> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> P; // const ll mod = 1e9 + 7; const l...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
362
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; #define ll long long #define re register #define pb push_back #define fi first #define se second const int N = 1e6 + 10; const int M = 1e6; const int mod7 = 1e9 + 7; const int mod = 998244353; void read(int &a) { a = 0; int d = 1; char ch; ...
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; #define ll long long #define re register #define pb push_back #define fi first #define se second const int N = 1e6 + 10; const int M = 1e6; const int mod7 = 1e9 + 7; const int mod = 998244353; void read(int &a) { a = 0; int d = 1; char ch; ...
[["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 109], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 12, 22]]
1
595
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ff first #define ss second #define pb push_back #define mp make_pair #define BUFF ios::sync_with_stdio(0); typedef long long int ll; typedef long double ld; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef vecto...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ff first #define ss second #define pb push_back #define mp make_pair #define BUFF ios::sync_with_stdio(0); typedef long long int ll; typedef long double ld; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef vecto...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]]
1
350
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (ll i = a; i < b; i++) #define REP(i, b) FOR(i, 0, b) #define RFOR(i, a, b) for (ll i = a - 1; i >= b; i--) #define RREP(i, a) RFOR(i, a, 0) #define REPALL(i, x) for (ll i = 0; i < x.size(); i++) #define RREPALL(i, x) for (ll i = x.size() - 1; i >= ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (ll i = a; i < b; i++) #define REP(i, b) FOR(i, 0, b) #define RFOR(i, a, b) for (ll i = a - 1; i >= b; i--) #define RREP(i, a) RFOR(i, a, 0) #define REPALL(i, x) for (ll i = 0; i < x.size(); i++) #define RREPALL(i, x) for (ll i = x.size() - 1; i >= ...
[["-", 31, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 31, 2, 3, 4, 0, 16, 31, 16, 12, 22]]
1
591
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = int(a); i < int(b); i++) typedef long long ll; const ll MOD = 998244353; ll fac[101100], finv[101100], inv[101100]; void init() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < 101100; i++) { fac[...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = int(a); i < int(b); i++) typedef long long ll; const ll MOD = 998244353; ll fac[201100], finv[201100], inv[201100]; void init() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < 201100; i++) { fac[...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
301
#include <bits/stdc++.h> #define REP(i, n) for (ll i = 0; i < n; i++) #define REPR(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (ll i = m; i <= n; i++) #define FORR(i, m, n) for (ll i = m; i >= n; i--) #define SORT(v, n) sort(v, v + n) #define MAX 100000 #define inf 1000000007 #define mod 998244353 //...
#include <bits/stdc++.h> #define REP(i, n) for (ll i = 0; i < n; i++) #define REPR(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (ll i = m; i <= n; i++) #define FORR(i, m, n) for (ll i = m; i >= n; i--) #define SORT(v, n) sort(v, v + n) #define MAX 100000 #define inf 1000000007 #define mod 998244353 //...
[["+", 0, 43, 49, 80, 81, 16, 31, 16, 31, 13], ["+", 0, 43, 49, 80, 81, 16, 31, 16, 17, 48]]
1
414
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb pushback #define fr(i, n) for (int i = 0; i < n; i++) #define fro(i, j, n) for (int i = j; i < n; i++) #define ifr(i, n) for (int i = n - 1; i >= 0; i--) const int MAX = 510000; const int MOD = 998244353; long long fac[MAX], finv[MAX], inv...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb pushback #define fr(i, n) for (int i = 0; i < n; i++) #define fro(i, j, n) for (int i = j; i < n; i++) #define ifr(i, n) for (int i = n - 1; i >= 0; i--) const int MAX = 510000; const int MOD = 998244353; long long fac[MAX], finv[MAX], inv...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 109], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
350
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <unordered_map> #include <vector> #define INCANT ...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <unordered_map> #include <vector> #define INCANT ...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13]]
1
345
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const int N = 2e5 + 9; const int mod = 998244353; ll n, k, m, ans; ll fact[N], inv[N]; ll fp(ll b, ll p) { if (p == 0) return 1; if (p & 1) return (b * fp(b, p - 1)) % mod; return fp((b * b) % mod, p / 2); } ll mul(ll a, ll b) { ret...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const int N = 2e5 + 9; const int mod = 998244353; ll n, k, m, ans; ll fact[N], inv[N]; ll fp(ll b, ll p) { if (p == 0) return 1; if (p & 1) return (b * fp(b, p - 1)) % mod; return fp((b * b) % mod, p / 2); } ll mul(ll a, ll b) { ret...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
380
N,M,K=map(int,input().split()) P=998244353 class FactInv: def __init__(self,N,P): fact=[];ifact=[];fact=[1]*(N+1);ifact=[0]*(N+1) for i in range(1,N): fact[i+1]=(fact[i]*(i+1))%P ifact[-1]=pow(fact[-1],P-2,P) for i in range(N,0,-1): ifact[i-1]=(ifact[i]*i)%P ...
N,M,K=map(int,input().split()) P=998244353 class FactInv: def __init__(self,N,P): fact=[];ifact=[];fact=[1]*(N+1);ifact=[0]*(N+1) for i in range(1,N): fact[i+1]=(fact[i]*(i+1))%P ifact[-1]=pow(fact[-1],P-2,P) for i in range(N,0,-1): ifact[i-1]=(ifact[i]*i)%P ...
[["-", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 31, 22], ["-", 0, 657, 31, 657, 12, 652, 3, 4, 0, 22], ["+", 0, 657, 31, 657, 12, 652, 3, 4, 0, 22], ["-", 31, 23, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 0, 657, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 657, 12, 652, 3, 4, 0, 657, 17, 33], ...
5
267
n, m, k = map(int, input().split()) def cmb(n, r, p): if (r < 0) or (n < r): return 0 r = min(r, n-r) return fact[n] *factinv[r]* factinv[n-r] %p p = 998244353 N = 2 * 10**5 + 1 fact = [1, 1] factinv = [1, 1] inv = [0, 1] for i in range(2, N+1): fact.append((fact[-1]*i)%p) inv.append((-in...
n, m, k = map(int, input().split()) def cmb(n, r, p): if (r < 0) or (n < r): return 0 r = min(r, n-r) return fact[n] *factinv[r]* factinv[n-r] %p p = 998244353 N = 2 * 10**5 + 2 fact = [1, 1] # fact[n] = (n! mod p) factinv = [1, 1] # factinv[n] = ((n!)^(-1) mod p) inv = [0, 1] # factinv 計算用 ...
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["-", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 31, 22], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 72]]
5
250
#include <bits/stdc++.h> #include <chrono> using namespace std::chrono; using namespace std; #define fr(x, i, n) for (int x = i; x < n; ++x) #define fb(x, i, n) for (int x = i; x >= n; --x) #define pr pair<int, int> #define ll long long int const ll mod = 998244353; /* auto start = high_resolution_clock::now(); ...
#include <bits/stdc++.h> #include <chrono> using namespace std::chrono; using namespace std; #define fr(x, i, n) for (int x = i; x < n; ++x) #define fb(x, i, n) for (int x = i; x >= n; --x) #define pr pair<int, int> #define ll long long int const ll mod = 998244353; /* auto start = high_resolution_clock::now(); ...
[["-", 0, 43, 49, 50, 51, 4, 0, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 31, 13]]
1
397
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, x) for (ll i = 0; i < (ll)(x); i++) #define rrep(i, x) for (ll i = (ll)(x)-1; 0 <= i; i--) #define reps(i, x) for (ll i = 1; i < (ll)(x) + 1; i++) #define rreps(i, x) for (ll i = (ll)(x); 1 <= i; i--) #define debug(x) cerr << #x << ": "...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, x) for (ll i = 0; i < (ll)(x); i++) #define rrep(i, x) for (ll i = (ll)(x)-1; 0 <= i; i--) #define reps(i, x) for (ll i = 1; i < (ll)(x) + 1; i++) #define rreps(i, x) for (ll i = (ll)(x); 1 <= i; i--) #define debug(x) cerr << #x << ": "...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13]]
1
1,454
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; #define REP(i, n, m) for (ll i = n; i < (ll)m; ++i) #define IREP(i, n, m) for (ll i = n - 1; i >= m; --i) #define rep(i, n) REP(i, 0, n) #define irep(i, n) IREP(i, n, 0) #d...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; #define REP(i, n, m) for (ll i = n; i < (ll)m; ++i) #define IREP(i, n, m) for (ll i = n - 1; i >= m; --i) #define rep(i, n) REP(i, 0, n) #define irep(i, n) IREP(i, n, 0) #d...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
438
#include <bits/stdc++.h> using namespace std; const int64_t MOD = 998244353; struct mint { int64_t x; mint(int64_t x = 0) : x((x % MOD + MOD) % MOD) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { if ((x += a.x) >= MOD) x -= MOD; return *this; } mint &operator-...
#include <bits/stdc++.h> using namespace std; const int64_t MOD = 998244353; struct mint { int64_t x; mint(int64_t x = 0) : x((x % MOD + MOD) % MOD) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { if ((x += a.x) >= MOD) x -= MOD; return *this; } mint &operator-...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 48], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
639
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; ll mod_pow(ll x, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } int main() { ll N, M, K, MOD = 998244353...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; ll mod_pow(ll x, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } int main() { ll N, M, K, MOD = 998244353...
[["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]]
1
253
// 2020年4月17日現在 #include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #inclu...
// 2020年4月17日現在 #include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #inclu...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
1,465
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x, to) for (x = 0; x < (to); x++) #define FORR(x, arr) for (auto &x : arr) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define ALL(a) (a.begin()), ...
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x, to) for (x = 0; x < (to); x++) #define FORR(x, arr) for (auto &x : arr) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define ALL(a) (a.begin()), ...
[["+", 0, 11, 12, 16, 31, 16, 31, 16, 17, 109], ["+", 0, 11, 12, 16, 31, 16, 31, 16, 12, 22]]
1
514
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <numeric> #include <queue> #include <regex> #include <set> #include <stack> #include <string> #include <tuple> #include <type_traits> #include <un...
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <numeric> #include <queue> #include <regex> #include <set> #include <stack> #include <string> #include <tuple> #include <type_traits> #include <un...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 46]]
1
3,459
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) #define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i) #define FOR(i, a, b) for (ll i = (a); i < (ll)(b); ++i) #define EFOR(i, a, b) for (ll i = (a); i <= (ll)(b); ++i) typedef pair<int, int> P; ll mod...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) #define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i) #define FOR(i, a, b) for (ll i = (a); i < (ll)(b); ++i) #define EFOR(i, a, b) for (ll i = (a); i <= (ll)(b); ++i) typedef pair<int, int> P; ll mod...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72]]
1
410
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) #define all(v) v.begin(), v.end() typedef long long ll; typedef pair<ll, ll> P; typedef vector<ll> vec; typedef vector<vec> mat; ll mod = 998244353; ll inv(ll a) { ll n = mod - 2, ans = 1; while (n > 0) { if (n & 1) ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) #define all(v) v.begin(), v.end() typedef long long ll; typedef pair<ll, ll> P; typedef vector<ll> vec; typedef vector<vec> mat; ll mod = 998244353; ll inv(ll a) { ll n = mod - 2, ans = 1; while (n > 0) { if (n & 1) ...
[["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
302
#include <bits/stdc++.h> #define ll long long #define SIZE 200010 using namespace std; const long long MOD = 998244353; long long fac[SIZE], inv[SIZE]; // fac 存储阶乘 inv 存储阶乘逆元 ll qpow(ll x, ll e, ll mod) { ll r = 1; while (e) { if (e & 1) r = r * x % mod; x = x * x % mod; e >>= 1; } return r...
#include <bits/stdc++.h> #define ll long long #define SIZE 200010 using namespace std; const long long MOD = 998244353; long long fac[SIZE], inv[SIZE]; // fac 存储阶乘 inv 存储阶乘逆元 ll qpow(ll x, ll e, ll mod) { ll r = 1; while (e) { if (e & 1) r = r * x % mod; x = x * x % mod; e >>= 1; } return r...
[["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
384
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define INF 100000000 #define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++) int n, m, k; ll mod = 998244353; ll comb(ll N_, ll C_) { const int NUM_ = 400001; static ll fact[NUM_ + 1], factr[NUM_ + 1], inv[NUM_ + 1]...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define INF 100000000 #define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++) int n, m, k; ll mod = 998244353; ll comb(ll N_, ll C_) { const int NUM_ = 400001; static ll fact[NUM_ + 1], factr[NUM_ + 1], inv[NUM_ + 1]...
[["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
352
#include <iostream> /* [x^Ny^K] \sum_{t=0}^\infty [(M-1)(x+yx^2+y^2x^3+...)]^t [x^Ny^K] 1/[1- (M-1)(x+yx^2+y^2x^3+...)] [x^Ny^K] 1/[1- (M-1)x/(1-yx)] [x^Ny^K] (1-yx)/[1-yx - (M-1)x] [x^Ny^K] (1-yx) \sum_{i=0}^\infty (yx+(M-1)x)^i [y^K] (y+(M-1))^N - y (y+(M-1))^{N-1} \binom{N}{K} (M-1)^{N-K} - \binom{N-1}{K-1} ...
#include <iostream> /* [x^Ny^K] \sum_{t=0}^\infty [(M-1)(x+yx^2+y^2x^3+...)]^t [x^Ny^K] 1/[1- (M-1)(x+yx^2+y^2x^3+...)] [x^Ny^K] 1/[1- (M-1)x/(1-yx)] [x^Ny^K] (1-yx)/[1-yx - (M-1)x] [x^Ny^K] (1-yx) \sum_{i=0}^\infty (yx+(M-1)x)^i [y^K] (y+(M-1))^N - y (y+(M-1))^{N-1} \binom{N}{K} (M-1)^{N-K} - \binom{N-1}{K-1} ...
[["+", 0, 1, 0, 16, 31, 16, 12, 2, 63, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25]]
1
288
#include <bits/stdc++.h> #define PI 3.14159265358979323846 #define MAXINF (1e18L) #define INF (1e9L) #define EPS (1e-9) #define MOD ((ll)(998244353)) #define REP(i, n) for (int i = 0; i < int(n); ++i) #define Rep(i, sta, n) for (int i = sta; i < n; i++) #define RREP(i, n) for (int i = int(n) - 1; i >= 0; --i) #define A...
#include <bits/stdc++.h> #define PI 3.14159265358979323846 #define MAXINF (1e18L) #define INF (1e9L) #define EPS (1e-9) #define MOD ((ll)(998244353)) #define REP(i, n) for (int i = 0; i < int(n); ++i) #define Rep(i, sta, n) for (int i = sta; i < n; i++) #define RREP(i, n) for (int i = int(n) - 1; i >= 0; --i) #define A...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
1,242
#include <bits/stdc++.h> #define be(v) (v).begin(), (v).end() #define pb(q) push_back(q) typedef long long ll; using namespace std; const ll mod = 1000000007, INF = mod * mod * 3LL; #define doublecout(a) cout << fixed << setprecision(10) << a << endl; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x...
#include <bits/stdc++.h> #define be(v) (v).begin(), (v).end() #define pb(q) push_back(q) typedef long long ll; using namespace std; const ll mod = 998244353, INF = mod * mod * 3LL; #define doublecout(a) cout << fixed << setprecision(10) << a << endl; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x(...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
687
#include <algorithm> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long int ll; /*bool compare_function(const pair<int, int> a, const pair<int, int> b) { return a.first < b.first; } use case sort(V.begin(), V.end(), com...
#include <algorithm> #include <iomanip> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long int ll; /*bool compare_function(const pair<int, int> a, const pair<int, int> b) { return a.first < b.first; } use case sort(V.begin(), V.end(), com...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
383
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using mii = map<int, int>; using mll = map<ll, ll>; using vi = vector<int>; using vii = vector<vi>; using vpi = vector<pii>; using vl = vector<ll>; using vll = vector<vl>; using vpl = vector<pll>; u...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using mii = map<int, int>; using mll = map<ll, ll>; using vi = vector<int>; using vii = vector<vi>; using vpi = vector<pii>; using vl = vector<ll>; using vll = vector<vl>; using vpl = vector<pll>; u...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108]]
1
730
#include <bits/stdc++.h> using namespace std; #define ll long long int #define MOD 998244353 #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define MOD 998244353 #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
541
mod = 998244353 n, m, k = map(int, input().split()) count = 0 comb = 1 for i in range(k + 1): tmp = comb * m * pow(m-1, n-i-1, mod) % mod count = (count + tmp) % mod comb = comb * (n - i) * pow(i+1, mod-2, mod) % mod print(count)
mod = 998244353 n, m, k = map(int, input().split()) count = 0 comb = 1 for i in range(k + 1): tmp = comb * m * pow(m-1, n-i-1, mod) % mod count = (count + tmp) % mod comb = comb * (n - i - 1) * pow(i+1, mod-2, mod) % mod print(count)
[["+", 31, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["+", 31, 657, 31, 657, 12, 23, 0, 657, 12, 612]]
5
96
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int lli; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<lli> vli; typedef vector<pii> vii; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_orde...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int lli; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<lli> vli; typedef vector<pii> vii; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_orde...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 12, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["+", 12, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 12, 22]]
1
1,356
P = 998244353 nn = 200200 fa = [1] * (nn+1) fainv = [1] * (nn+1) for i in range(nn): fa[i+1] = fa[i] * (i+1) % P fainv[-1] = pow(fa[-1], P-2, P) for i in range(nn)[::-1]: fainv[i] = fainv[i+1] * (i+1) % P def comb(a, b): return fa[a] * fainv[b] % P * fainv[a-b] % P if 0 <= b <= a else 0 N, M, K = map...
P = 998244353 nn = 200200 fa = [1] * (nn+1) fainv = [1] * (nn+1) for i in range(nn): fa[i+1] = fa[i] * (i+1) % P fainv[-1] = pow(fa[-1], P-2, P) for i in range(nn)[::-1]: fainv[i] = fainv[i+1] * (i+1) % P def comb(a, b): return fa[a] * fainv[b] % P * fainv[a-b] % P if 0 <= b <= a else 0 N, M, K = map...
[["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 60]]
5
263
#include <bits/stdc++.h> #define int long long #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); using namespace...
#include <bits/stdc++.h> #define int long long #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); using namespace...
[["-", 64, 9, 0, 57, 64, 1, 0, 2, 63, 22], ["-", 0, 57, 64, 1, 0, 2, 3, 4, 0, 24], ["-", 0, 57, 64, 1, 0, 2, 3, 4, 0, 147], ["-", 0, 57, 64, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 57, 64, 9, 0, 57, 64, 37, 0, 38], ["+", 0, 57, 64, 9, 0, 57, 64, 37, 0, 13]]
1
319
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vii; typedef vector<ll> vll; typedef pair<int, int> pii; #define FASTIO \ ios::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vii; typedef vector<ll> vll; typedef pair<int, int> pii; #define FASTIO \ ios::sync_with_stdio(false); ...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
891
/* AUTHOR:SOURABH CREATED:06:05:20 */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ordered_set \ tree<pll, null_type, less<pll>, rb_tree_tag, \ tree_...
/* AUTHOR:SOURABH CREATED:06:05:20 */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ordered_set \ tree<pll, null_type, less<pll>, rb_tree_tag, \ tree_...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
466
N,M,K = gets.split.map(&:to_i) Mod = 998244353 D,U = [1],[1] [K,N-K].min.times{|i| i+=1 D << D[-1]*(N-i)%Mod U << U[-1]*i%Mod } U.map!{|_| _.pow(Mod-2,Mod) } Com = lambda{|r| r = [N-1-r,r].min D[r] * U[r] % Mod } p (0..K).inject(0){|a,k| (a + Com[k] * M * (M-1).pow(N-1-k,Mod)) % Mod }
N,M,K = gets.split.map(&:to_i) Mod = 998244353 D,U = [1],[1] [K,N/2].min.times{|i| i+=1 D << D[-1] *(N-i) % Mod U << U[-1] * i % Mod } U.map!{|_| _.pow(Mod-2,Mod) } Com = lambda{|r| r = [N-1-r,r].min D[r] * U[r] % Mod } p (0..K).inject(0){|a,k| (a + Com[k] * M * (M-1).pow(N-1-k,Mod)) % Mod }
[["-", 0, 652, 486, 652, 486, 516, 0, 738, 17, 33], ["-", 0, 652, 486, 652, 486, 516, 0, 738, 12, 743], ["+", 0, 652, 486, 652, 486, 516, 0, 738, 17, 85], ["+", 0, 652, 486, 652, 486, 516, 0, 738, 12, 612]]
4
171
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define int long long #define vec(a, n) vector<int>(a)((n)); #define Vec(a, n) vector<string>(a)((n)); #define twovec(a, n, m) vector<vector<int>> a(n, vector<int>(m, 0)); #define Twovec(a, n, m...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define int long long #define vec(a, n) vector<int>(a)((n)); #define Vec(a, n) vector<string>(a)((n)); #define twovec(a, n, m) vector<vector<int>> a(n, vector<int>(m, 0)); #define Twovec(a, n, m...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 49, 53, 54, 55, 0, 56, 0, 153, 0, 154]]
1
1,172
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <numeric> #include <string> #include <vector> using namespace std; typedef long long ll; const ll MOD = 998244353; ll N, M, K; ll power(ll a, ll b) { ll ret = 1; while (b) { if (b & 1) { ...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <numeric> #include <string> #include <vector> using namespace std; typedef long long ll; const ll MOD = 998244353; ll N, M, K; ll power(ll a, ll b) { ll ret = 1; while (b) { if (b & 1) { ...
[["-", 31, 16, 12, 2, 3, 4, 0, 16, 31, 22], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 31, 22]]
1
200
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13]]
1
1,137
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; #define LL long long LL MOD = 998244353, MAX = 222222; LL N, M, K; LL fac[2222...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; #define LL long long LL MOD = 998244353, MAX = 222222; LL N, M, K; LL fac[2222...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
383
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) typedef unsigned long long ULL; const int nMax = 1e5 + 1, MOD = 998244353; ULL inv[nMax], fct[nMax], ivf[nMax]; ULL Comb(int n, int r) { return (((fct[n] * ivf[r]) % MOD) * ivf[n - r]) % MOD; } ULL pw(ULL a, ULL n) { ...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) typedef unsigned long long ULL; const int nMax = 2e5 + 1, MOD = 998244353; ULL inv[nMax], fct[nMax], ivf[nMax]; ULL Comb(int n, int r) { return (((fct[n] * ivf[r]) % MOD) * ivf[n - r]) % MOD; } ULL pw(ULL a, ULL n) { ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13]]
1
344
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unorder...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unorder...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
991
#include <stdio.h> #include <string.h> const int MAX = 210000; const int MOD = 998244353; long long fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD...
#include <stdio.h> #include <string.h> const int MAX = 210000; const int MOD = 998244353; long long fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD...
[["-", 0, 14, 8, 9, 0, 57, 64, 37, 0, 13], ["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 13]]
1
416
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const ll mod = 998244353; struct mint { ll x; mint(ll x = 0) : x((x % mod + mod) % mod) {} //カッコの中で初期化している mint &operator+=(const mint a) { // operatorは構造体同士の比較に用いられる if ((x += a.x) >= mod) ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int mod = 998244353; struct mint { ll x; mint(ll x = 0) : x((x % mod + mod) % mod) {} //カッコの中で初期化している mint &operator+=(const mint a) { // operatorは構造体同士の比較に用いられる if ((x += a.x) >= mod) ...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 12, 13]]
1
524
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' #define mod 1000000007 #define modulo 998244353 #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ll fact[...
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' #define mod 1000000007 #define modulo 998244353 #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ll fact[...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 31, 23, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
364
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define ll long long #define vecll vector<long long> #define vec2ll vector<vector<long long>> #define vecpairll vector<pair<long long, long long>> #define forll(s, a, b) for (long long s = a; s < b; s++) #define forllde(s, a) for (long long s = a; s ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define ll long long #define vecll vector<long long> #define vec2ll vector<vector<long long>> #define vecpairll vector<pair<long long, long long>> #define forll(s, a, b) for (long long s = a; s < b; s++) #define forllde(s, a) for (long long s = a; s ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107]]
1
371
#pragma region Include #include <bits/stdc++.h> #pragma endregion using namespace std; #pragma region Macros typedef pair<int, int> pii; typedef long long ll; typedef vector<int> vi; typedef vector<vector<int>> vvi; #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second ...
#pragma region Include #include <bits/stdc++.h> #pragma endregion using namespace std; #pragma region Macros typedef pair<int, int> pii; typedef long long ll; typedef vector<int> vi; typedef vector<vector<int>> vvi; #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second ...
[["+", 64, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 64, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["-", 0, 16, 12, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 16, 12, 2, 3, 4, 0, 16, 12, 22]]
1
925
#### 逆元リストいらない mod = 998244353 fact = [1] fact_inv = [1] for i in range(10**5+5): new_fact = fact[-1]*(i+1)%mod fact.append(new_fact) fact_inv.append(pow(new_fact,mod-2,mod)) def mod_comb_k(n,k,mod): return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod def power_func(a,n,p): bi=str(format(n,"b"))#2...
#### 逆元リストいらない mod = 998244353 fact = [1] fact_inv = [1] for i in range(2*10**5+2): new_fact = fact[-1]*(i+1)%mod fact.append(new_fact) fact_inv.append(pow(new_fact,mod-2,mod)) def mod_comb_k(n,k,mod): return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod def power_func(a,n,p): bi=str(format(n,"b"))...
[["+", 12, 652, 3, 4, 0, 657, 31, 657, 31, 612], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 17, 48], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
239
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; using lint = long long; constexpr int MOD = 998244353, INF = 1010101010; constexp...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; using lint = long long; constexpr int MOD = 998244353, INF = 1010101010; constexp...
[["+", 8, 9, 0, 43, 49, 53, 54, 55, 0, 24], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 8, 9, 0, 43, 49, 53, 54, 55, 0, 25]]
1
1,103
# coding: utf-8 import sys sys.setrecursionlimit(1000000) N,M,K=map(int,input().split()) MOD=998244353 MAX_N=N #a**n mod p を再帰的に求める def modPow(a,n,p): if n==0: return 1 if n == 1: #n=1ならaを返す return a % p elif n % 2 == 1: #nが奇数ならば a * modPow(a,n-1(偶数),p)を返す return a...
# coding: utf-8 import sys sys.setrecursionlimit(1000000) N,M,K=map(int,input().split()) MOD=998244353 MAX_N=N+10 #a**n mod p を再帰的に求める def modPow(a,n,p): if n==0: return 1 if n == 1: #n=1ならaを返す return a % p elif n % 2 == 1: #nが奇数ならば a * modPow(a,n-1(偶数),p)を返す retur...
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
379
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <tuple> #include <vector> #define FOR(i, a, b) for (ll i = a; i < b; i++) #define CST(x) cout ...
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <tuple> #include <vector> #define FOR(i, a, b) for (ll i = a; i < b; i++) #define CST(x) cout ...
[["-", 0, 30, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
389
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define rrep(i, n) for (int i = n - 1; i >= 0; --i) #define fi first #define se second using namespace std; using lint = long long; using uint = unsigned int; using ulint = unsigned long long; using ldouble = long double; using pii = pair<int, int>;...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define rrep(i, n) for (int i = n - 1; i >= 0; --i) #define fi first #define se second using namespace std; using lint = long long; using uint = unsigned int; using ulint = unsigned long long; using ldouble = long double; using pii = pair<int, int>;...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
553