121032024-12-02 15:16:15KissCsongor777Késéscpp14Compilation error
#include <iostream>
#include <map>
using namespace std;

int main()
{
    int N,x,m=INT_MAX;
    cin>>N;
    map<int, int> H;
    for(int i=1; i<=N; i++)
    {
        cin>>x;
        H[x]=i;
    }
    map <int, int>::iterator h;
    for(h=H.begin();h!=H.end(); h++)
    {
        if(m>h->second)m=h->second;
    }
    cout<<m;
    return 0;
}
Compilation error
open /var/local/lib/isolate/412/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:7:15: error: 'INT_MAX' was not declared in this scope
    7 |     int N,x,m=INT_MAX;
      |               ^~~~~~~
main.cpp:3:1: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
    2 | #include <map>
  +++ |+#include <climits>
    3 | using namespace std;