yhtyyar.s's blog

By yhtyyar.s, history, 6 years ago, In English

Does anyone actually know the reason of why vintage_Vlad_Makeev is lowering his rating?
It might be:
- He wants to set codeforces record of max rating gained in 1 contest (after he will reach bottom, 1 contest with all problems solved)
- After failing to become legendary grandmaster, he gained rage.
- He sold his accaunt.
- Russian hackers hacked his account.
- He wants to be first in becoming newbie after grandmaster.

What is your opinion?

Full text and comments »

  • Vote: I like it
  • +63
  • Vote: I do not like it

By yhtyyar.s, history, 7 years ago, In English

Hi Codeforces. Today i saw GreenGrape solution of the problem D. Robot Vacuum Cleaner : 35053688. And i find there :

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)

while (t--) {
		clock_t z = clock();
		solve();
		debug("Total Time: %.3f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
	}

With this code he gets execution time of function solve(). clock() gives you current time. It is useful to avoid time limits. I have wrote helpful macro and decided to share with you :

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
           
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))

with this u can get execution time of parts of your programm. Example:

int main () {
     /*reading data*/
     time__("dfs"){
          /* dfs code */
     }
     /*some code*/
     time__("solve"){
       solve();
     }
}

And programm will print something like dfs time : 0.2650s, solve time:0.0010s. You don't need to erase debugging part when you will submit it. Example submission: 35088800. Thank you for reading and I hope it will help you

Full text and comments »

  • Vote: I like it
  • +19
  • Vote: I do not like it

By yhtyyar.s, history, 7 years ago, In English
logo
CROATIAN OPEN COMPETITION IN INFORMATICS

Internet online contest series
Announcement

20.01.2018.
14:00 GMT/UTC

You can login/register here:here

Good Luck!

Full text and comments »

  • Vote: I like it
  • +19
  • Vote: I do not like it