Cod sursa(job #93779)

Utilizator recviemAlexandru Pana recviem Data 20 octombrie 2007 11:06:06
Problema Datorii Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <stdio.h>

int c[15000],a[15000],n;
long m;

void push(int k,int x)
{
	while (k<=m)
	{
		c[k] -= x;
		k=k+((k^(k-1))&k);		
	}
}

void citire()
{
	freopen("datorii.in","r",stdin);
	scanf("%d%d",&m,&n);
	for (int i=1;i<=m;i++)
	{
		int z;
		scanf("%d",&z);
		push(i,-1*z);
	}
	for(int i=0;i<n;i++)
	{
		int x,y,z;
		scanf("%d%d%d",&x,&y,&z);
		switch x:
		{
		case 0: push (z,y);
		case 1:
		}
	}
	fclose(stdin);
}

int main()
{
	citire();
	return 0;
}