QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#713471 | #2851. 生生不息 | HHAZ# | AC ✓ | 0ms | 3656kb | C++20 | 1.7kb | 2024-11-05 19:32:53 | 2024-11-05 19:32:54 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int>pii;
typedef pair<ll,ll>pll;
typedef pair<ld,ld>pdd;
typedef pair<ll, pair<ll, ll> > plpair;
typedef vector<int> vi;
typedef vector<ll> vl;
//#define endl '\n'
#define rep(i, a, b) for (ll i = (a); i <= (b); ++i)
#define per(i, a, b) for(ll i = (a); i >= (b); --i)
#define debug(x) cout<<#x<<": "<<x<<endl
#define lowbit(id) id & (-id)
#define fi first
#define sec second
#define lc id<<1
#define rc id<<1|1
#define sz(x) (int)(x).size()
#define all(t) (t).begin(), (t).end()
#define meh {cout<<"NO"<<endl;return;}
#define yay {cout<<"YES"<<endl;return;}
#define vin(v) for(auto&x:v)cin>>x;
#define print(v) for (auto x: v)cout<<x<<' ';cout<<endl;
#define sqrt(x) sqrtl(x)
mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count());
const ll N = 10;
const ll mod = 2148473648;
ll ans[6][6];
void solve() {
ll x, y;
cin >> x >> y;
cout << ans[x][y] << endl;
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
// freopen("test.in","r",stdin);
// freopen("test.out","w",stdout);
int T=1;
cin>>T;
ans[1][1] = 0;
ans[1][2] = 0;
ans[1][3] = 0;
ans[1][4] = 0;
ans[1][5] = 0;
ans[2][1] = 0;
ans[2][2] = 5;
ans[2][3] = 18;
ans[2][4] = 73;
ans[2][5] = 267;
ans[3][1] = 0;
ans[3][2] = 18;
ans[3][3] = 150;
ans[3][4] = 1533;
ans[3][5] = 11398;
ans[4][1] = 0;
ans[4][2] = 73;
ans[4][3] = 1533;
ans[4][4] = 31828;
ans[4][5] = 469972;
ans[5][1] = 0;
ans[5][2] = 267;
ans[5][3] = 11398;
ans[5][4] = 469972;
ans[5][5] = 12785753;
while(T--)
{
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3656kb
input:
25 2 4 2 3 2 1 1 5 4 2 5 4 5 3 2 5 1 4 4 4 5 2 5 1 4 5 3 3 3 2 4 3 5 5 3 1 4 1 3 5 3 4 1 3 1 2 2 2 1 1
output:
73 18 0 0 73 469972 11398 267 0 31828 267 0 469972 150 18 1533 12785753 0 0 11398 1533 0 0 5 0
result:
ok 25 lines