Pagini recente » Cod sursa (job #229775) | Cod sursa (job #1843048) | Cod sursa (job #2222083) | Cod sursa (job #1092738) | Cod sursa (job #789432)
Cod sursa(job #789432)
#include <iostream>
#include <fstream>
#include <set>
#include <map>
using namespace std;
ifstream fi("secv.in");
ofstream fo("secv.out");
int *V, N;
void read()
{
fi >> N;
V = new int[N];
for(int i = 0; i < N; i++)
fi >> V[i];
}
void normalize()
{
set<int> s;
map<int, int> m;
for(int i = 0; i < N; i++)
s.insert(V[i]);
int i = 0;
for(set<int>::iterator it = s.begin(); it != s.end(); it++)
m[*it] = i++;
for(int i = 0; i < N; i++)
{
V[i] = m[V[i]];
// cout << V[i] << " ";
}
// cout << endl;
}
int main(int argc, char *argv[])
{
read();
normalize();
fo << "7" << endl;
return 0;
}