/**
____ ____ ____ __________________ ____ ____ ____
||I || ||c || ||e || || || ||M || ||a || ||n ||
||__|| ||__|| ||__|| ||________________|| ||__|| ||__|| ||__||
|/__\| |/__\| |/__\| |/________________\| |/__\| |/__\| |/__\|
*/
#include <iostream>
#include <chrono>
#include <vector>
#include <algorithm>
#include <assert.h>
#include <queue>
#include "gondola.h"
#define maxn 1005
#define maxlog 20
#define INF 1000000010
#define LINF 1000000000000000005
#define endl '\n'
#define pb(x) push_back(x)
#define X first
#define Y second
#define control cout<<"passed"<<endl;
using namespace std;
typedef pair <int, int> pii;
typedef long long ll;
typedef pair <ll, ll> pll;
typedef pair <int, ll> pil;
typedef pair <ll, int> pli;
typedef long double ld;
std::chrono::high_resolution_clock::time_point startT, currT;
constexpr double TIME_MULT = 1;
double timePassed()
{
using namespace std::chrono;
currT = high_resolution_clock::now();
double time = duration_cast<duration<double>>(currT - startT).count();
return time * TIME_MULT;
}
int valid(int n, int a[])
{
map <int , int> br;
int minn = INF , idx;
for(int i = 0; i < n; i++)
{
if(minn > a[i])
{
minn = a[i];
idx = i;
}
br[a[i]]++;
if(br[a[i]] > 1)
return false;
}
if(minn > n)
return true;
int curr = minn + 1;
for(int i = idx + 1; i % n != idx; i++)
{
if(a[i % n] <= n && a[i % n] != curr)
return false;
curr++;
}
return true;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return 0;
}
int countReplacement(int n, int inputSeq[])
{
return 0;
}
/**int main()
{
#ifdef ONLINE_JUDGE
freopen("input.in", "r", stdin);
freopen("output.out", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
///startT = std::chrono::high_resolution_clock::now();
return 0;
}
*/
Compilation message
gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:55:5: error: 'map' was not declared in this scope
55 | map <int , int> br;
| ^~~
gondola.cpp:17:1: note: 'std::map' is defined in header '<map>'; did you forget to '#include <map>'?
16 | #include "gondola.h"
+++ |+#include <map>
17 |
gondola.cpp:55:10: error: expected primary-expression before 'int'
55 | map <int , int> br;
| ^~~
gondola.cpp:66:9: error: 'br' was not declared in this scope
66 | br[a[i]]++;
| ^~