It’s because of the lines:
# define ll long long
...
# define int ll
This makes it impossible to write
int main()
as normal as that would expand to
long long main()
which is a compiler error, so int32_t is used as a workaround.
It’s because of the lines:
# define ll long long
...
# define int ll
This makes it impossible to write
int main()
as normal as that would expand to
long long main()
which is a compiler error, so int32_t is used as a workaround.
Oh i see, thanks btw
Can anyone explain or send links about these lines and this #pragma … I read about this on the net but I’m not finding any hard data
Its related to some compiler optimizations.
does it become fast ?
Instead of answering that, I’d tell you that a codeforces blog tells all details about this
for ease. Easy to replace int with typdef int long long int.
Well, I wanted you to google it yourself to get it, but here you go-
There was also a pretty nice explanation as comment by MrDindows but I cannot find it atm.
thanks for answering all my questions
I can’t understand the line equal_next=(equal & next_digit>vec[idx]), shouldn’t it be (equal & digit>vec[idx])?
We are seeing if after placing next digit what is the state of equal.
You said I can request for an unapproved editorial of CHGORAM and SYNBAC from you. How do I do that?
Please upload CHGORAM, I’ve been searching for a plausible solution for over a week now, Or you could just submit your own code with few comments first, and later add an editorial. So we could think about the solution in the mean time
There’s a Video Editorial for CHGORAM here:
and, though people are probably sick of me posting it by now, here’s my fully-documented submission (highly-commented code, plus high-level, Editorial-style overview). Not been proof-read
Did you not take part in yesterday’s Cook-Off?
No, I’m a slow, slow old man and there’s no way I’d be able to compete with all you young whipper-snappers Long Challenges only, for me!
2.5 hours for 5 questions? I’d spend longer than that agonizing over variable names XD
but you seem to be a good problem solver, would have given us ‘young whipper-snappers’ a good competition. Anyway, I know you are one of the Competitive Programmers who writes very clean code, probably a habit you carried over from your experience as developer(saw your LinkedIn profile). So, you are an asset to the community. Nevertheless, see you in September Long and hitting 4 or higher star this time.
Thanks for the very kind words I’m a very inconsistent problem solver - I’m quite often stumped for a long time over surprisingly simple things (coming from Hackerrank, it was a real eye-opener seeing what problems were classified as “Easy” here :)) - this is really not a good recipe for success with short challenges
Anyway, while I’m here - I’d like to say how much I love the long-form format here - so much less stressful than Hackerrank, where in their equivalent (the “Week of Code”) you still only have one day to solve a challenge (if you want full marks on it), plus they have the “Additional Testcases” which just add to the pressure! I couldn’t believe it when I saw that you had a full 10 days to solve all the challenges here. It’s great