Submission #397623

# Submission time Handle Problem Language Result Execution time Memory
397623 2021-05-02T15:05:35 Z victoriad Kisik (COCI19_kisik) C++14
0 / 90
2000 ms 67008 KB
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <queue>
#include <map>
#include <iomanip>
#include <fstream>
using namespace std;
int k;
void min(int &n,vector<int>&h,vector<int>&w,int x,int y,int nodo,int z){
  if(z==k){
    if(x*y<n&& z==k){
      n=x*y;
    }
    return;
  }
  if(nodo<h.size()){
  min(n,h,w,x,y,nodo+1,z);
  x+=w[nodo];
  y=max(y,h[nodo]);
  min(n,h,w,x,y,nodo+1,z+1);
  }
}

int main(){
  ios::sync_with_stdio(false);
   cin.tie(NULL);
   int n;
   cin>>n>>k;
   vector<int>w(n);
   vector<int>h(n);
   for(int i=0;i<n;i++){
     cin>>w[i]>>h[i];
   }
   int r=1e9;
   vector<int>a;
   min(r,h,w,0,0,0,0);
   cout<<r;
  return 0;
}

Compilation message

kisik.cpp: In function 'void min(int&, std::vector<int>&, std::vector<int>&, int, int, int, int)':
kisik.cpp:20:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |   if(nodo<h.size()){
      |      ~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Execution timed out 2070 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2070 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2083 ms 336 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2073 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2077 ms 30148 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2084 ms 43332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2085 ms 25156 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2075 ms 31684 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2088 ms 67008 KB Time limit exceeded
2 Halted 0 ms 0 KB -