Complete shitpost, don't take it seriously. We were discussing #define int long long and I suggested defining it to one letter if you want to save on typing so desperately. jeroenodb said that those are reserved for variables, which prompted me to think, "Is there a letter I don't standardly use for some particular purpose?" Then I compiled the following list, and then I thought, "Well, I already wrote it, let's put it on cf", so here we are.
a - array, but also all sorts of stuff
b - second array
c - third array / count
d - delta / divisor
e - event / edge
f - flag
g - graph / second flag
h - third iterator / third flag / height
i - iterator
j - second iterator
k - third input size / some parameter (i know, those are all parameters, but for some reason k is parameter)
l - left
m - number of edges / second input size
n - input size
o - ???
p - permutation / position
q - number of queries / query / second permutation / second position
r - right
s - string
t - tests / time / temp
u - second vertex
v - vertex
w - weight / value (because v is vertex???)
x - variable in math sense / x coordinate
y - y coordinate
z - use when need some letter that won't be used / z coordinate








I have at times used o/z to keep track of the number of ones/zeroes in an array (often later realizing that I could simply have used
cnt[2]). Note that this is a particularly cursed used ofoas it looks like a0but is being used to indicate ones here, and I have indeed made mistakes because of this.i do the same yo
Also I sometimes use
oandefor even and odd counts.or just use it for orz
so instead of o we can named variable as o1 and e1
I use
f&sfor first and secondcry when's your next contest coming?
In problems that involve multiple types of operations, I tend to use
oto denote the type of operation, since it’s the first letter of "operation". Although in some fonts it can indeed be confused with0, usingofor the operation type rarely causes naming conflicts in practice.I have used
oa handful of times for a random variable name I confirmo += 1is awful 3/10I use o for the order of a certain array, when you want to do some sort without messing with the original array. For example when doing MO i might do an implementation like that:
same, and then I use ro for like ro[o[i]] = i;
The real unused character is
_It's not that it will never be used. I have previously used this variable name for the following purposes, to avoid occupying other variable names:
There's no reason for it to be outside
mainand waste a global variable nameYes, so I don't use it that way anymore. Now the only use of '_' for me is to serve as a non-repeating iterator name when I run out of i, j, k. Perhaps there's a better solution?
I use
lfor 4th iteratorIt is very used for me when a variable is only modified in one place and accessed in one place. Examples are
for (const auto &_: g[u]) { int v=_.first,w=_.second; ... },int _;cin>>_;while (_--) { ... }, etc.no its $
No,
#define $ << fixed << setprecision(10) <<Why would you need a macro for that if you only use it once? Just use a snippet
During debugging I end up using that way more than once :)) (and I cannot configure the editor fast in onsite contests)
Wow, how the hell dollar is not a special character in C++? No other characters in identifiers seem to work for me except
_and dollar.Actually I always use struct _ in my code instead of mypair or such.
me too
.
I do use it sometimes as blank placeholders, when I want to input 2 lists and then pair them up at the same time.
I feel like it would be a bit more ergonomic to just use
auto& [x, y]both times since it allows for copy-pasting and changing a single character.I agree with that
Nah, you use that to
#define _ << ' ' <<In many languages
_means a discarded return value. iirc in C++23_also means a discarded value/placeholder in structured binding.I use it a lot for foreach loops with vectors of pairs, when I am only interested in one element on that loop, helps me keep track of what I am doing or something, don't know why I started, but now I always do it
for example
And I also sometimes use it as a loop iterator when the iterator variable only needs to loop but doesn't need to be accessed inside the loop
For me,
fanddare sometimes for dp, andg,hfor the second and the third dp array.o-??? r-right z-use me!!
You could use o for 1 to trick people into hacking your solutions thinking you have an off by 1 bug but it might violate code obfuscation rules and also requires hacking to be common in contests.
I use
const modint<998244353> o=0;I tend to use o to mean offset.
'o' for ones in zero and one array + odd even tracking also sometimes.
I name similarly. So do I think like an LGM?!
edit: this was meant to be a joke
o: odd
then I find out my code is failing because I wrote cnt = o instead of cnt = 0
If you really want to save as much time as possible on typing, you should be naming all of the variables 30+ symbols, so you train your typing speed while solving problems.
And after 10 years of CP you switch to 1 letter variables only to achieve maximum speed!
Am I the only one who always preferred using u as the first vertex and v as the second vertex?
It makes more sense to me since u comes before v in the alphabet and the edge is u -> v.
It makes less sense because v stands for vertex
same
I was thinking the same thing. As a Spanish speaker, the word for "neighbor" is "vecino", so for me it's more intuitive to use "$$$v$$$" for the second vertex. I also agree with your argument about using "$$$u$$$" for the first vertex because it comes first in the alphabet.
That's the way.
auto dfs = [&](auto&& self, int u, int p = -1)pfor parent ofu.same, for some reason
ulooks more like "primary" andvas "secondary" in my mindI use some of these, but everyone seems to have their own preferred variable and macro style. and i think That’s totally fine — as long as the code remains readable to you (and your teammates).
you use capital letters too when it gets real
I usually use k as a third iterator.
My most controversial one-letter variable naming's got to be using
zfor the third vertex (specifically,lca(u, v)). Come at me.I use o — operator
I use o for "order", when ord is already taken
sometimes i define m as for mod purpose like m=1e9+7
If common small ones get used up, use their capital form.
o : ok
d — disrance and depth also s — sum t — temporary trash variable For me, in addition to above. In rest it all pretty much matches my usage of the letters haha
v — vector
o — answer, output
There is something worse than
#define int long long"just hear me out" ahh naming
Then what about
I do this, and I don't like it, but haven't found something better :(
f also flow
l for list
For me:
But there are no fathers in trees. There are only parents.
You are right, but I'm already used to it...
Well I think use
sforsumis quite suitableI usually use o for a iterator which is necessary but barely appears in any calculating of at least two variables lol
You can use ll like most of us. But if you really want to save time... You can try using '**o**'. If you say '**o**' is not even similar to long long or ll, then you can use L.
This is painfully accurate.
I've always assumed 'o' was for 'origin', but I've never actually used it. It's the emergency letter for when you run out of everything else.
Also, 'c' is frequently cost for me, especially in graph problems where w is already taken for weight.
So true lol
'o' can be count of odds, meanwhile i use 'q' for priority_queue
I also sometimes use o and e for even and odd counts.
What about one uppercase letter names? C for binomial, I and J for iterators, X for random intermediate value, A and B when the answer is A-B
v for value, w for walue
i for index, j for jndex XD
sometimes i use
ofororiginal, like ov — original value, nv — new value, but hardly use a singleoas a nameI have always been advised against using single-letter variables.
I remember that I've recently posted similar comment. But turned out it was 10 years ago...
Here it is
I often use $$$t$$$ for second string, and $$$f$$$ for dp table.
you all cheaters should learn from this blog
this
Maybe in some data structures when we need to
maintain two operations, 1 for ... and 2 for ..., we may useDo you really think people who use #define int long long do so because long long is too long to type? We'd use #define ll long long then
I agree with you, that was just some context for how I have come to write this list.
I think starters normally use int, then not used to changing to long long so they use #define int long long.
Me:'o' for 'OMG What this'
f can be function, then g could be second function, and h third function.
I use d for
deez nuts
random name for me(in 2024.12~2025.7)(in order)(includes delta height ...) h y l z x now the same,except a,b,c,d added
so "z" is just useless -_-
and the funny thing is that I use "z" the most)
Great blog that helps me understand more about code habits. Here are some additional meanings (completely coming from my own style.)
p[]ands[]can also be used for prefixs and suffixes.Sometimes, I use
s[]to represent the size of a certain array or something similar to that.z[]is sometimes used in the ex-kmp algorithm.this is so accurate lmao
I sometime use p as prefix, s as sum and k as the third iterator
$$$\texttt{Variable 'o' stands for "Oh no, where did my bug go?"}$$$
I use the letter “o” to represent the abbreviation of “ok”, or simply because in some places using it looks round and cute.
This post reminded me of the exact same conversation i had years ago. Editoral for a problem used a variable named not o, not oo, but ooo. We were flabbergasted to say the least
Don't know about others ,but I find capital variable naming like A,M,N,O,I,J,CC,TT,MM,NN much handy xD , A, B -vectors
M,N — input size O- odd even counts I,J ->auto iterators CC ,TT — count . etc
Yeah, I always name these single-letter variables uppercase.
Helpfull
Not one letter variables but I almost always use
set<int> ste;andmap<int,int> mpa;I have used o a handful of times for a random variable name "ones" to count the number of ones in the string or array :)