39012023-03-03 19:54:45kohumarkMágikus táblázatcpp17Wrong answer 0/100583ms5400 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]++; l++; ma=min(ma,act[j]);
                sol=max(sol,ma*l);
            }
            else{act[j]=0;l=0;ma=1e9;}
        }
    }
    
    cout << sol;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1828 KiB
2Accepted456ms2284 KiB
subtask20/14
3Wrong answer3ms2248 KiB
4Accepted3ms2460 KiB
5Wrong answer3ms2584 KiB
6Accepted3ms2796 KiB
7Accepted2ms2764 KiB
8Accepted3ms3040 KiB
subtask30/27
9Wrong answer8ms3128 KiB
10Wrong answer8ms3296 KiB
11Wrong answer8ms3308 KiB
12Accepted8ms3312 KiB
13Accepted4ms3300 KiB
14Accepted4ms3432 KiB
15Wrong answer7ms3444 KiB
16Wrong answer9ms3456 KiB
17Accepted7ms3524 KiB
subtask40/21
18Time limit exceeded569ms4024 KiB
19Time limit exceeded575ms4096 KiB
20Time limit exceeded564ms4372 KiB
21Time limit exceeded551ms4320 KiB
22Time limit exceeded560ms4280 KiB
23Time limit exceeded568ms4124 KiB
24Accepted6ms4316 KiB
subtask50/38
25Time limit exceeded580ms4596 KiB
26Time limit exceeded560ms4540 KiB
27Time limit exceeded575ms4480 KiB
28Time limit exceeded551ms4536 KiB
29Time limit exceeded560ms4872 KiB
30Time limit exceeded575ms4944 KiB
31Time limit exceeded551ms4952 KiB
32Time limit exceeded579ms4576 KiB
33Time limit exceeded560ms4656 KiB
34Time limit exceeded583ms4776 KiB
35Time limit exceeded560ms4652 KiB
36Time limit exceeded579ms5136 KiB
37Time limit exceeded579ms5076 KiB
38Time limit exceeded568ms5048 KiB
39Time limit exceeded547ms5060 KiB
40Time limit exceeded568ms5188 KiB
41Time limit exceeded568ms4924 KiB
42Time limit exceeded555ms5300 KiB
43Time limit exceeded552ms5400 KiB
44Time limit exceeded537ms5224 KiB