Pagini recente » Cod sursa (job #2807894) | Cod sursa (job #1804335) | Cod sursa (job #1793748) | Cod sursa (job #2811777) | Cod sursa (job #3162150)
#include <iostream>
#include <vector>
#include <fstream>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
vector<vector<int>>H;
int get_nr_cif(int x)
{
int cnt=0;
while(x>0)
{
cnt++
x=x/10;
}s
return cnt;
}
long long putere(x,put)
{
long long val=1
while(put>0)
{
val=val*x;
put--;
}
return val;
}
const int b=23;
const int mod=833927;
long long hashumeu(long long x)
{
int nr_cif=get_nr_cif(x);
while(nr_cif>0)
{
nr_cif--;
val_cod+=putere(b,nr_cif)*x%10;
x=x/10;
}
return val_cod%mod;
}
int main()
{
int n;
int op;
long long x;
fin>>n;
for(int i=1;i<=n;i++)
{
fin>>op>>x;
if(op==1)
{
std::vector<int>::iterator it=find(H)
if()
H[hashumeu(x)].push_back(x);
}
}
}