Cod sursa(job #3204245)
Utilizator | Enal Gemaledin Blaugranas | Data | 16 februarie 2024 08:18:54 |
---|---|---|---|
Problema | Dtcsu | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<fstream>
using namespace std;
ifstream F("dtcsu.in");
ofstream G("dtcsu.out");
long long n=276997,s,r,t,i,k;
long long a[276997],m;
int main()
{
for(;n--;)
if(F>>i,i&1)
a[k++]=i;
for(s=1;s<k;s<<=1);
for(F>>n;n--;r+=a[i]==m) {
for(F>>m;!(m&1);m>>=1);
for(i=0,t=s;t;t>>=1)
if(i+t<k&&a[i+t]<=m)
i+=t;
}
return G<<r,0;
}