39022023-03-03 20:01:00kohumarkMágikus táblázatcpp17Wrong answer 0/100600ms5588 KiB
#include <iostream>
#include <vector>
using namespace std;

int main(){
    cin.tie(0); ios_base::sync_with_stdio(false);
    int n,m; cin >> n >> m;
    int a[n]; int b[m];
    for(int i=0; i<n; i++) cin >> a[i];
    for(int i=0; i<m; i++) cin >> b[i];
    
    vector<int> act; act.assign(m,0);
    int l=0; int ma=1e9; int sol=0;
    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            if(a[i]>=b[j]){
                act[j]++;
            }
            else{act[j]=0;}
        }
        for(int j=0; j<m; j++) for(int k=j; k<m; k++){
            ma=min(ma,act[k]); sol=max(ma*(k-j+1),sol);
        }
        ma=1e9;
    }
    
    cout << sol;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms2104 KiB
2Time limit exceeded600ms1720 KiB
subtask20/14
3Accepted3ms2308 KiB
4Wrong answer3ms2704 KiB
5Accepted3ms2676 KiB
6Wrong answer3ms2760 KiB
7Wrong answer3ms2672 KiB
8Accepted3ms2864 KiB
subtask30/27
9Time limit exceeded565ms3004 KiB
10Time limit exceeded514ms3068 KiB
11Time limit exceeded570ms3328 KiB
12Time limit exceeded578ms2672 KiB
13Time limit exceeded570ms3476 KiB
14Time limit exceeded555ms3476 KiB
15Time limit exceeded550ms3616 KiB
16Time limit exceeded566ms3712 KiB
17Time limit exceeded555ms3916 KiB
subtask40/21
18Time limit exceeded575ms4272 KiB
19Time limit exceeded555ms4600 KiB
20Time limit exceeded555ms4484 KiB
21Time limit exceeded568ms4548 KiB
22Time limit exceeded532ms4616 KiB
23Time limit exceeded583ms4508 KiB
24Time limit exceeded559ms4368 KiB
subtask50/38
25Time limit exceeded570ms4900 KiB
26Time limit exceeded555ms5048 KiB
27Time limit exceeded570ms4764 KiB
28Time limit exceeded566ms4840 KiB
29Time limit exceeded536ms4828 KiB
30Time limit exceeded560ms4804 KiB
31Time limit exceeded555ms4756 KiB
32Time limit exceeded583ms4760 KiB
33Time limit exceeded551ms4864 KiB
34Time limit exceeded527ms4760 KiB
35Time limit exceeded564ms4736 KiB
36Time limit exceeded551ms5156 KiB
37Time limit exceeded547ms5120 KiB
38Time limit exceeded572ms5168 KiB
39Time limit exceeded556ms5308 KiB
40Time limit exceeded568ms5380 KiB
41Time limit exceeded569ms5104 KiB
42Time limit exceeded560ms5192 KiB
43Time limit exceeded569ms5588 KiB
44Time limit exceeded551ms5484 KiB