Budz's blog

By Budz, history, 5 weeks ago, In English

These 2 solutions differ only in use of predefined max and #define max .

TLE code

AC code

Please provide detailed explanation to me, it took forever to debug. Thanks

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Budz (previous revision, new revision, compare).

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

I don't know how much I can help you, but I found this.

STD:MIN issue

»
5 weeks ago, # |
Rev. 2   Vote: I like it +13 Vote: I do not like it

This is what happens with the macro:

(func(one) + ... < func(zero) + ... ? func(zero) + ... : func(one) + ...)

Either func(one) or func(zero) will be called twice, once for the comparison and once for the actual call.