Cod sursa(job #1336086)

Utilizator Just2Dr3amFlavius Atanasoae Just2Dr3am Data 6 februarie 2015 16:52:46
Problema Arbori Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.87 kb
#include<iostream>
#include<fstream>
#include<cmath>
using namespace std;
ifstream f("scmax.in");
ofstream g("scmax.out");
using namespace std;
int c[100];
int main ()
{
    long long n,n1=0,aux=0,c=0,s=0,aux1=0,n2=0,i,x[1000],y[100],a,b,asd=0,asdfghjkl,nr=0,j;
    f>>a>>b;
    for(i=1;i<=a;i++)
        f>>x[i];
    for(i=1;i<=b;i++)
        f>>y[i];
    for(i=a;i>=1;i--)
        {
                if((x[i]%10==0)||(x[i]%10==1))
                        n1+= (x[i]%10) * pow(2,aux++);
        }
    for(i=b;i>=1;i--)
        {
                if((y[i]%10==0)||(y[i]%10==1))
                        n2+= (y[i]%10) * pow(2,aux1++);
        }
        int p10=1;
        asdfghjkl=n1-n2;
        while(asdfghjkl)
        {
            s=s+p10*(asdfghjkl%2);
            p10=p10*10;
            asdfghjkl=asdfghjkl/2;
        }
        g<<s;

    return 0;
}