QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#21521 | #2851. 生生不息 | hy_zheng_zai_nei_juan# | AC ✓ | 3ms | 3580kb | C++20 | 1.5kb | 2022-03-07 14:31:11 | 2022-05-08 03:35:48 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<vector>
#include<queue>
#include<algorithm>
#include<string>
#include<sstream>
#include<cctype>
#include<cmath>
#include<iomanip>
#include<map>
#include<stack>
#include<set>
#include<functional>
#define in(x) x=read()
#define qr read()
#define int ll
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
namespace fastIO
{
#define BUF_SIZE 100000
bool IOerror=0;
inline char nc()
{
static char buf[BUF_SIZE],*p1=buf+BUF_SIZE,*pend=buf+BUF_SIZE;
if (p1==pend){
p1=buf; pend=buf+fread(buf,1,BUF_SIZE,stdin);
if (pend==p1){IOerror=1;return -1;}
}
return *p1++;
}
inline bool blank(char ch){return ch==' '||ch=='\n'||ch=='\r'||ch=='\t';}
inline ll read()
{
bool sign=0; char ch=nc();ll x=0;
for (;blank(ch);ch=nc());
if (IOerror)return 0;
if (ch=='-')sign=1,ch=nc();
for (;ch>='0'&&ch<='9';ch=nc())x=x*10+ch-'0';
if (sign)x=-x;
return x;
}
#undef BUF_SIZE
};
using namespace fastIO;
int ans[5][5]={{0,0,0,0,0},
{0,5,18,73,267},
{0,18,150,1533,11398},
{0,73,1533,31828,469972},
{0,267,11398,469972,12785753}};
signed main()
{
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
int T=qr;
while(T--)
{
int n=qr,m=qr;n--,m--;
cout<<ans[n][m]<<'\n';
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 3ms
memory: 3580kb
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