Cod sursa(job #726720)

Utilizator valentin.harsanValentin Harsan valentin.harsan Data 27 martie 2012 14:22:07
Problema Plantatie Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.54 kb
#include<iostream>
#include<fstream>
using namespace std;

ifstream in("plantatie.in");
ofstream out("plantatie.out");

const int N = 502;

int n,m,x[N][N],aib[N][N];

inline void update(int I, int J, int val) {
	
	for(;i<=n;i+=i&(-i))
		for(;j<=n;j+=j&(-j))
			aib[i][j]+=val;
}
inline int q(int i, int j) {
	int rez = 0;
	
	for(;i!=0;i-=i&(-i))
		for(;j!=0;j-=j&(-j))
}

int main() {
	int i,j;
	
	in >> n >> m;
	
	for(i=1;i<=n;++i)
		for(j=1;j<=n;++j) {
			in >> x[i][j];
			update(i,j,x[i][j]);
		}
	
	return 0;
}