zplesivcak's blog

By zplesivcak, 7 years ago, In English

hac 1.0.5 released (2015-10-16)

hac is a command-line tool that:

  • prepares source-code templates,
  • downloads test-cases,
  • evaluates solution against test-cases.

hac is highly extensible and configurable, it has it's own plugin system that dynamically discovers:

  • site-processors (Python files for handling sites like Codeforces),
  • programming language and "runner" (e.g. shell script) templates.

Links

Acknowledgement

I was inspired to write hac by previous work of some other people [1] [2] [3] [4] [5]. I would like to thank those people as well as everyone else invested in the Codeforces community (admins, contest-organizers)! <3

[1] http://codeforces.com/blog/entry/15871

[2] http://codeforces.com/blog/entry/10416

[3] https://github.com/lovrop/codeforces-scraper

[4] https://github.com/dj3500/hightail

[5] http://codeforces.com/blog/entry/3273

Read more »

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

By zplesivcak, 7 years ago, In English

I don't know how to approach this question. Can someone please help me? Thank you.

Problem statement:

Given an array A[1...N] of positive integers, you have to sort it in ascending order in the following manner : In every operation, select any 2 non-overlapping sub-arrays of equal length and swap them. i.e, select two sub-arrays A[i...(i+k-1)] and A[j...(j+k-1)] such that i+k-1 < j and swap A[i] with A[j], A[i+1] with A[j+1] ... and A[i+k-1] with A[j+k-1].

Example:

For n = 6 and array ( 6 7 8 1 2 3 ), only one operation is needed as after swapping ( 6 7 8 ) and ( 1 2 3 ) sub-arrays we can get ( 1 2 3 6 7 8 ), that is sorted array.

Source: Careercup

Read more »

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