151882025-02-15 23:44:41balintttDarabolás (50 pont)cpp17Wrong answer 0/50300ms1076 KiB
#include <iostream>                                                                                                                                              
#include <vector>                                                                                                                                                
#include <algorithm>                                                                                                                                             
                                                                                                                                                                 
using namespace std;                                                                                                                                             
                                                                                                                                                                 
int main() {                                                                                                                                                     
    int m, n;                                                                                                                                                    
    cin >> m >> n;                                                                                                                                               
                                                                                                                                                                 
    vector<int> horizontal_cuts(m - 1);                                                                                                                          
    for (int i = 0; i < m - 1; i++) {                                                                                                                            
        cin >> horizontal_cuts[i];                                                                                                                               
    }                                                                                                                                                            
                                                                                                                                                                 
    vector<int> vertical_cuts(n - 1);                                                                                                                            
    for (int i = 0; i < n - 1; i++) {                                                                                                                            
        cin >> vertical_cuts[i];                                                                                                                                 
    }                                                                                                                                                            
                                        
    int total_cost = 0;              
    for (int i = 0; i < m - 1; i++) {                                           
        for (int j = 0; j < n - 1; j++) {                                                                                                                        
            int cost = min(horizontal_cuts[i], vertical_cuts[j]);
            total_cost += cost;                                                 
        }                                                                       
    }                                   
                                        
    cout << total_cost << endl;         
                                        
    return 0;                  
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms500 KiB
2Time limit exceeded0/0279ms796 KiB
3Wrong answer0/11ms316 KiB
4Wrong answer0/11ms316 KiB
5Wrong answer0/12ms396 KiB
6Wrong answer0/12ms508 KiB
7Wrong answer0/11ms316 KiB
8Wrong answer0/11ms316 KiB
9Wrong answer0/11ms316 KiB
10Wrong answer0/11ms316 KiB
11Wrong answer0/11ms316 KiB
12Wrong answer0/11ms316 KiB
13Wrong answer0/11ms316 KiB
14Wrong answer0/12ms316 KiB
15Wrong answer0/12ms400 KiB
16Wrong answer0/12ms556 KiB
17Wrong answer0/13ms316 KiB
18Wrong answer0/12ms316 KiB
19Wrong answer0/22ms316 KiB
20Wrong answer0/22ms316 KiB
21Wrong answer0/327ms440 KiB
22Wrong answer0/398ms436 KiB
23Time limit exceeded0/4246ms620 KiB
24Time limit exceeded0/4246ms748 KiB
25Time limit exceeded0/4286ms820 KiB
26Time limit exceeded0/4284ms820 KiB
27Time limit exceeded0/4273ms1064 KiB
28Time limit exceeded0/4300ms1076 KiB