0

Hello this is my code:

/*

Set time here:
    Start: 2021-06-12 22:09:26
    End(when AC):

*/


/*
Author: Shobhit Tewari
*/

#include<bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;


#define int long long
#define null 0
#define fio ios_base::sync_with_stdio(false); cin.tie(null);

#define pb push_back
#define sz(v) (int)(v.size())
#define all(v) v.begin(), v.end()

const int mod = 1e9 +7;
const int infinity = INT32_MAX;
const double pi = 3.1415926535897932384626433832795;

void solve(){
    
}

signed main(){
    fio;
    int t=1;
    //cin >> t;
    while(t--){
        solve();
    }
    return 0;
}

Intellisense in VS code is showing a squiggly line(error) under using of oset.

For the using in the oset is says: expected a declarationC/C++(169)

Can someone please help me out as I am not able to understand and also the code compiles and runs fine.

Shobhit Tewari
  • 535
  • 5
  • 20
  • `__gnu_pbds` is reserved for use by the implementation and may not even exist. Why are you trying to use it ? – Richard Critten Jun 12 '21 at 18:48
  • I saw this here and I really liked the idea of template it beforehand and use it like this: https://gist.github.com/vipul43/3b34d1f1cb14333a3e23830c29200a0d – Shobhit Tewari Jun 12 '21 at 19:01
  • See [Why should I not #include ?](https://stackoverflow.com/q/31816095) and [Why using namespace std is bad practice](https://stackoverflow.com/questions/1452721). – prapin Jun 12 '21 at 20:57
  • Your code is full of horrors: for example `#define int long long`, `using namespace __gnu_pbds`... In fact, everything before `solve()` function looks like garbage. – prapin Jun 12 '21 at 21:02
  • 1
    Please, if you really want to learn C++, please don't copy-paste code from competitive sites like those from vipul43. It is just a concentrate of bad habits that will horrify any future colleague. – prapin Jun 12 '21 at 21:11
  • Thank you for your helpful comments. 1=> I know cpp but not namespaces concept that's why I am asking. 2=> This is not a development environment. 3=> I learned what PBDS is and what it is doing but the thing of using it with custom type without writing it over and over again attracted me(the template concept). 4=> int as long long I know what you mean but it helps me in coding fast(not development). 5=> About __gnu_pbds I am not sure what it is, I just saw that to use pbds I needed that. – Shobhit Tewari Jun 12 '21 at 21:21
  • Thank you for the bits/stdc++.h I replaces it with custom headers. – Shobhit Tewari Jun 12 '21 at 21:37

0 Answers0