//pransh_8
#include <bits/stdc++.h>
#include "candies.h"
using namespace __gnu_pbds;
using namespace std;
//Macros:
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(a) a.begin(),a.end()
#define ff first
#define ss second
#define int long long
#define inf 9223372036854775807
#define pii pair<int, int>
#define vtr vector
#define pob pop_back
#define pb push_back
#define endl "\n"
#define tab "\t"
#define spc ' '
#define typ typename
#define printif(condition,str1,str2) cout<<((condition)?str1:str2) << endl
#define FOR(i, a, n) for(int i=a;i<n;++i)
#define FORR(i, a, n) for(int i=a;i>=n;--i)
/*------------------------------Code-Begins----------------------------------*/
vector<int> distribute_candies(vector<int> c, vtr<int> l, vtr<int> r, vtr<int> v) {
int n = c.size(), q = l.size();
vtr<int> ans(n);
FOR(i,0,q) {
FOR(k,l[i]-1,r[i]) {
if (v[i]>0)
ans[k]=min(c[k],ans[k]+v[i]);
else
ans[k]=max(0ll,ans[k]+v[i]);
}
}
return ans;
}
Compilation message
candies.cpp:5:17: error: '__gnu_pbds' is not a namespace-name
5 | using namespace __gnu_pbds;
| ^~~~~~~~~~