3903 | 2023-03-03 20:07:52 | kohumark | Mágikus táblázat | cpp17 | Time limit exceeded 14/100 | 600ms | 5628 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++){
ma=1e9;
for(int k=j; k<m; k++){
ma=min(ma,act[k]); sol=max(ma*(k-j+1),sol);
}
}
}
cout << sol;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1828 KiB | ||||
2 | Time limit exceeded | 600ms | 1496 KiB | ||||
subtask2 | 14/14 | ||||||
3 | Accepted | 3ms | 2444 KiB | ||||
4 | Accepted | 3ms | 2648 KiB | ||||
5 | Accepted | 3ms | 2732 KiB | ||||
6 | Accepted | 3ms | 2712 KiB | ||||
7 | Accepted | 3ms | 2676 KiB | ||||
8 | Accepted | 3ms | 2904 KiB | ||||
subtask3 | 0/27 | ||||||
9 | Time limit exceeded | 564ms | 3124 KiB | ||||
10 | Time limit exceeded | 578ms | 3160 KiB | ||||
11 | Time limit exceeded | 565ms | 3288 KiB | ||||
12 | Time limit exceeded | 578ms | 3500 KiB | ||||
13 | Time limit exceeded | 555ms | 3544 KiB | ||||
14 | Time limit exceeded | 555ms | 3676 KiB | ||||
15 | Time limit exceeded | 564ms | 3776 KiB | ||||
16 | Time limit exceeded | 540ms | 4124 KiB | ||||
17 | Time limit exceeded | 523ms | 4080 KiB | ||||
subtask4 | 0/21 | ||||||
18 | Time limit exceeded | 551ms | 4332 KiB | ||||
19 | Time limit exceeded | 560ms | 4396 KiB | ||||
20 | Time limit exceeded | 583ms | 4464 KiB | ||||
21 | Time limit exceeded | 555ms | 4668 KiB | ||||
22 | Time limit exceeded | 560ms | 4368 KiB | ||||
23 | Time limit exceeded | 536ms | 4308 KiB | ||||
24 | Time limit exceeded | 566ms | 4136 KiB | ||||
subtask5 | 0/38 | ||||||
25 | Time limit exceeded | 579ms | 4820 KiB | ||||
26 | Time limit exceeded | 572ms | 5276 KiB | ||||
27 | Time limit exceeded | 527ms | 5144 KiB | ||||
28 | Time limit exceeded | 578ms | 5208 KiB | ||||
29 | Time limit exceeded | 575ms | 5092 KiB | ||||
30 | Time limit exceeded | 568ms | 4820 KiB | ||||
31 | Time limit exceeded | 579ms | 4896 KiB | ||||
32 | Time limit exceeded | 580ms | 4588 KiB | ||||
33 | Time limit exceeded | 540ms | 4740 KiB | ||||
34 | Time limit exceeded | 579ms | 5040 KiB | ||||
35 | Time limit exceeded | 547ms | 5056 KiB | ||||
36 | Time limit exceeded | 564ms | 5588 KiB | ||||
37 | Time limit exceeded | 551ms | 5584 KiB | ||||
38 | Time limit exceeded | 588ms | 5556 KiB | ||||
39 | Time limit exceeded | 560ms | 5628 KiB | ||||
40 | Time limit exceeded | 540ms | 5500 KiB | ||||
41 | Time limit exceeded | 560ms | 5176 KiB | ||||
42 | Time limit exceeded | 572ms | 5428 KiB | ||||
43 | Time limit exceeded | 549ms | 5448 KiB | ||||
44 | Time limit exceeded | 552ms | 5332 KiB |