QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#713471#2851. 生生不息HHAZ#AC ✓0ms3656kbC++201.7kb2024-11-05 19:32:532024-11-05 19:32:54

Judging History

你现在查看的是最新测评结果

  • [2024-11-05 19:32:54]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3656kb
  • [2024-11-05 19:32:53]
  • 提交

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