giveChoc(long int idx, long int limit){
if(arr[idx][limit] != 0){
count += arr[idx][limit];
return;
}
if(idx > limit){
return;
}
if(limit == 1){
arr[idx][limit] += 1;
count += 1;
}
giveChoc(1, limit-1);
giveChoc(idx+1, limit);
}
int main(){
int t;
long int n, m;
cin >>t;
while(t--){
count = 0;
for(int i=0; i<100000; i++){
for(int j=0; j<100000; j++)
arr[i][j] = 0;
}
cin >>n >>m;
giveChoc(m, n);
cout <<count <<endl;
}
return 0;
}
whats wrong in this program ?
It looks like you posted long piece of code, consider editing it out and putting it on hastebin.com and pasting link to it instead. Alternatively, send your code in a file.
USe pastebin plssssssssssssssssssssss
do you have enough ram for 10^10 long ints?
Write fucking comments
Обсуждают сегодня