QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#21563#2851. 生生不息gsh#AC ✓2ms3552kbC++20810b2022-03-07 15:05:252022-05-08 03:38:27

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-08 03:38:27]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3552kb
  • [2022-03-07 15:05:25]
  • 提交

answer

#include<algorithm>
#include<iostream>
#include<vector>
#include<cstdio>
using namespace std;
#define For(i,l,r) for(int i=l;i<=r;i++)
#define FOR(i,l,r) for(int i=l;i>=r;i--)
#define MAXN 100001

int get(){int x=0,f=1;char c=getchar();while(c<'0'||c>'9')c=='-'&&(f=-1),c=getchar();while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();return x*f;}
int a[6][6];
int main()
{
	a[1][1]=0;
	a[1][2]=0;
	a[1][3]=0;
	a[1][4]=0;
	a[1][5]=0;
	a[2][1]=0;
	a[2][2]=5;
	a[2][3]=18;
	a[2][4]=73;
	a[2][5]=267;
	a[3][1]=0;
	a[3][2]=18;
	a[3][3]=150;
	a[3][4]=1533;
	a[3][5]=11398;
	a[4][1]=0;
	a[4][2]=73;
	a[4][3]=1533;
	a[4][4]=31828;
	a[4][5]=469972;
	a[5][1]=0;
	a[5][2]=267;
	a[5][3]=11398;
	a[5][4]=469972;
	a[5][5]=12785753;
	int T=get();
	while(T--)
	cout<<a[get()][get()]<<'\n';
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3552kb

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