Submission #158763

# Submission time Handle Problem Language Result Execution time Memory
158763 2019-10-18T16:41:25 Z InfiniteJest Cipele (COCI18_cipele) C++14
Compilation error
0 ms 0 KB
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;

ifstream in("input.txt");
ofstream out("output.txt");

typedef long long ll;

int n,m;
int va[100001];
int vb[100001];

bool funz(int k){
  imt indp=0;
  for(int i=0;i<m;i++){
    bool flag=0;
    for(int y=indp;y<n;y++){
      if(abs(va[i]-vb[i])<=k){
        flag=1;
        indp=y+1;
      }
    }
    if(!flag)return 0;
  }
  return 1;
}

int main(){
  cin>>n>>m;
  for(int i=0;i<n;i++)cin>>va[i];
  for(int i=0;i<m;i++)cin>>vb[i];
  sort(va,va+n);
  sort(vb,vb+m);
  if(n<m){
    swap(va,vb);
    swap(n,m);
  }

  int s=0;
  int d=1e9+4;
  int minn=1e9+4;
  while(s<=d){
    int k=(s+d)/2;
    if(funz(k)){
      minn=min(minn,k);
      d=k-1;
    }
    else{
      s=k+1;
    }
  }
  cout<<minn;



}

Compilation message

cipele.cpp: In function 'bool funz(int)':
cipele.cpp:25:3: error: 'imt' was not declared in this scope
   imt indp=0;
   ^~~
cipele.cpp:25:3: note: suggested alternative: 'int'
   imt indp=0;
   ^~~
   int
cipele.cpp:28:15: error: 'indp' was not declared in this scope
     for(int y=indp;y<n;y++){
               ^~~~
cipele.cpp:28:15: note: suggested alternative: 'in'
     for(int y=indp;y<n;y++){
               ^~~~
               in