Cod sursa(job #1733385)

Utilizator r00t_Roman Remus r00t_ Data 24 iulie 2016 16:41:31
Problema Datorii Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.66 kb
#include <fstream>
#include <cmath>
#include <vector>

#define zeros(x)(x^(x-1)&x)

using namespace std;

ifstream fin("datorii.in");
ofstream fout("datorii.out");

int v1[1000000],c[10000000],n,m;


int main()
{
    fin>>n;
    for(int i=0;i<n;i++)
        fin>>v1[i];
    fin>>cod;
    while(cod!=3){
        if(cod==1){
            fin>>ind>>val;
            poz=0;
            while(ind<=n){
                c[ind]=c[ind]+val;
                while(ind&pow(2,poz)==0){
                    poz++;
                }
                ind=ind + pow(2,poz);
                poz=poz+1;
            }
        }
        else {

        }
    }
}