Linux tsuru-no-tsurugi 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.0.18 & Your IP : 216.73.217.105
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
submit2 /
114908 /
Delete
Unzip
Name
Size
Permission
Date
Action
a.cpp
1.47
KB
-rwxr-x---
2024-08-28 22:35
cerror.txt
0
B
-rwxr-x---
2024-08-28 22:35
error.txt
62
B
-rwxr-x---
2024-08-28 22:35
submit_info.txt
467
B
-rwxr-x---
2024-08-28 22:35
Save
Rename
#include <iostream> #include <vector> #include <algorithm> using namespace std; const int MOD = 127237991; const int N = 5; int n; vector<vector<int>> a(N); vector<vector<long long>> memo(N, vector<long long>(N)); vector<vector<bool>> visit(N, vector<bool>(N, false)); long long f(int x, int y) { if (visit[x][y]) return memo[x][y]; if (x == N - 1) return 1; int m = upper_bound(a[x + 1].begin(), a[x + 1].end(), a[x][y]) - a[x + 1].begin(); if (m == n) return 0; long long cnt = 0; for (int i = m; i < n; i++) { cnt += f(x + 1, i); cnt %= MOD; } memo[x][y] = cnt; visit[x][y] = true; return memo[x][y]; } long long g(int x, int y) { int m = upper_bound(a[x + 1].begin(), a[x + 1].end(), a[x][y]) - a[x + 1].begin(); if (m == n) return 0; return memo[x + 1][m]; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; for (int i = 0; i < N; i++) { a[i].resize(n); for (int j = 0; j < n; j++) { cin >> a[i][j]; } sort(a[i].begin(), a[i].end()); } long long ans = 0; ans += f(0, 0) % MOD; for (int i = 1; i < N; i++) { for (int j = n - 1; j > 0; j--) { memo[i][j - 1] += memo[i][j]; memo[i][j - 1] %= MOD; } } for (int i = 1; i < n; i++) { ans += g(0, i) % MOD; } cout << ans % MOD << endl; return 0; }