QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#21549 | #2851. 生生不息 | gogo# | AC ✓ | 2ms | 3584kb | C++20 | 1.2kb | 2022-03-07 14:58:02 | 2022-05-08 03:37:32 |
Judging History
answer
#include<bits/stdc++.h>
#define rep(i, l, r) for(int i = (l); i <= (r); i ++)
#define per(i, r, l) for(int i = (r); i >= (l); i --)
#define trv(i, u, v) for(int i = head[u], v = e[i].to; i; v = e[i = e[i].nxt].to)
#define fi first
#define se second
#define all(s) s.begin(), s.end()
#define sz(s) (int)(s.size())
#define lb(s) ((s) & -(s))
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
mt19937_64 hua(time(0));
template<typename T> inline bool chkmx(T &x, T y) {return x < y ? x = y, 1 : 0;}
template<typename T> inline bool chkmn(T &x, T y) {return y < x ? x = y, 1 : 0;}
template<int T> using A = array<int, T>;
inline int read() {
int x = 0, f = 1; char c = getchar();
for(; !isdigit(c); c = getchar()) if(c == '-') f = 0;
for(; isdigit(c); c = getchar()) x = x * 10 + c - '0';
return f ? x : -x;
}
int ans[6][6];
int main() {
// freopen("in.txt", "r", stdin);
ans[2][2] = 5;
ans[2][3] = 18;
ans[3][3] = 150;
ans[2][4] = 73;
ans[3][4] = 1533;
ans[4][4] = 31828;
ans[5][5] = 12785753;
ans[4][5] = 469972;
ans[3][5] = 11398;
ans[2][5] = 267;
for(int T = read(); T; T --) {
int n = read(), m = read();
if(n > m) swap(n, m);
cout << ans[n][m] << '\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3584kb
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