/*
#ifndef ONLINE_JUDGE
#include "AkbarKING.h"
#else
#define debug(...)
#define debugArr(...)
#define debugG(...)
#endif
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/hash_policy.hpp>
#define int long long
#define $AzH_TxdmN$ ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
///*
#define NaxcivanlilaraEkranKaydiAlmayaSonOnlardaInsanKimiKocureBilerlerVeSecmedeGCD100LeyeBilerler dp[1][1];
#define Aliyyiakbar dp[i][j]
#define MirrehimM dp[0][0]
#define Xanlar dp[i-1][j]
#define Elay dp[i][j-1]
#define Rufo dp[i-1][j-1]
#define Yusif dp[i+1][j]
#define Sayad dp[i][j+1]
#define Sumuraz dp[i+1][j+1]
#define Cebrayil dp[i+1][j-1]
#define Riyad dp[n][m]
#define Huseyn dp[n-1][m]
#define Zako dp[n][m-1]
#define Abdulla dp[n-1][m-1]
#define Subhan dp[n+1][m]
#define Sadiks dp[i+1][j-1]
#define Khadija dp[i-1][j+1]
///*/
#define ep emplace_back
#define pb push_back
#define pii pair<int,int>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using __indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using __indexed_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937_64 rng(chrono::steady_clock().now().time_since_epoch().count());
const int sz = 2e3 + 9;
const int LOG = 63;
const int MOD = 1e9 + 7;
const int INF = 1e18;
int dp[sz][sz];
int n, a, b;
void solve()
{
cin >> n >> a >> b;
MirrehimM = 1;
for (int i = 1; i <= n; ++i)
{
for (int j = 1; j <= n; ++j)
{
if (i == a || i == b)
{
Aliyyiakbar = ((Xanlar + Rufo) % MOD + MOD) % MOD;
}
else
{
Aliyyiakbar = (((((((Khadija * j) % MOD + MOD) % MOD) + ((((Rufo * (j - (i > a) - (i > b))) % MOD) + MOD) % MOD) + MOD) % MOD) + MOD) % MOD + MOD) % MOD;
}
}
}
cout << dp[n][1] << '\n';
}
signed main()
{
$AzH_TxdmN$
int t = 1;
// cin >> t;
while (t--)
{
solve();
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |