Cod sursa(job #1326107)
| Utilizator | Data | 24 ianuarie 2015 18:21:53 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.49 kb |
#include<fstream>
#include<unordered_set>
using namespace std;
ifstream in("dtcsu.in");
ofstream out("dtcsu.out");
const int nmax = 13;
unordered_set<long long> s;
long long n, x;
int q, rasp;
int main(){
int player_unu=0;
for(int i = 0; i<nmax; i++)
{
in>>x;
if(x%2==1)
s.insert(x);
}
in>>q;
for(int shp = 0; shp<q; shp++)
{
in>>x;
x /= ((x ^ (x - 1)) & x);
if(s.find(x)!=s.end())
rasp++;
}
out<<rasp<<'\n';
return player_unu;
}