- using namespace std;
- variable names inconsistent and random, using uppercase and lowercase randomly (code also would not compile since it is cased randomly)
- indenting and braces inconsistent
- use of macros for trivial tasks where they are absolutely not required
- use of macros in totally dangerous ways ("#define all(c) c.begin(), c.end()", seriously?)
- usage of compiler dependent features
- code should be for "competitive programming", and proposes a vector of vectors to make a 2D matrix
- Counterproductive and unhelpful typedefs
EDIT:
I'd like to tell you more, but looking at that page is making me feel unwell. The ostringstream example seems to be out of a nightmare. Just learn C++ from a reputable source and save yourself and everybody else around you the pain.
Before people lynch me, I just wants emphasize again that I'm not defending these practices in production code, but the article wasn't advocating that either. And of course there's the old debate about whether the contests themselves become harmful because they encourage bad practice, and that may be true, but that's a different conversation.
Perhaps we should read "competitive programming" as "programming quickly without regard for quality." Taken that way, the article could even be titled "programming to impress nontechnical managers so you can become one."
what would be the right way to do this?
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
#define sz(a) int((a).size())
#define pb push_back
#defile all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())Just write C. C++ is too much of a pain.
(For context, I'm mainly a C / Python / Unix Programmer, with an interest in common sense and architectures based on clean plain data interfaces instead of wrong abstractions, and with a good track on SPOJ)