Advertisement
Dmaxiya

化食欲为动力 参考代码

Mar 30th, 2025
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long LL;
  5. const int maxn = 200 + 100;
  6. int n, m, k;
  7. LL ans;
  8. LL a[maxn], b[maxn], c[maxn];
  9.  
  10. int main() {
  11. #ifdef ExRoc
  12.     freopen("test.txt", "r", stdin);
  13. #endif // ExRoc
  14.     ios::sync_with_stdio(false);
  15.  
  16.     cin >> n >> m >> k;
  17.     for (int i = 0; i < n; ++i) {
  18.         cin >> a[i];
  19.     }
  20.     for (int i = 0; i < m; ++i) {
  21.         cin >> b[i];
  22.     }
  23.     for (int i = 0; i < k; ++i) {
  24.         cin >> c[i];
  25.     }
  26.     for (int i = 0; i < n; ++i) {
  27.         for (int j = 0; j < m; ++j) {
  28.             for (int kk = 0; kk < k; ++kk) {
  29.                 ans = max(ans, a[i] * b[j] % c[kk]);
  30.             }
  31.         }
  32.     }
  33.     cout << ans << endl;
  34.  
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement