DaurenMuratov's blog

By DaurenMuratov, 13 years ago, translation, In English

Hello everyone!
I just installed Ubuntu 11.02, and I'm not so good in Ubuntu. Can someone help me, show me some thinks.
For ex: How to check time limits? I know that "time" command can help, but I don't know how to use it. And can I write something like test.bat and stress.bat on Linux? Maybe, someone can show me examples of these codes on Linux or give some information about it.
Thanks in advance!

Tags c++
  • Vote: I like it
  • +1
  • Vote: I do not like it

13 years ago, # |
  Vote: I like it +1 Vote: I do not like it
To check time limit is very easy. you can write "time ./a.out", where a.out - is your compiled program. (a.out could be obtained by command "g++ A.cpp" )
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
How does test.bat and stress.bat look like? (I have never used them) If you show their source code -- I think it's not difficult to write something similar in Linux.
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    I have already written it somewhere, it should be bash script looking similar to this:
    <pre><code class="bash">
    #!/bin/bash
    for ((i=0;i<10000;i++)); do
        ./gen > input
        ./a < input > output
        ./a_bruteforce <  input > ans
        ./check output ans || exit
    done
    </code></pre>
    • 13 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      can you explain how to use this code?
      • 13 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        create test.sh
        paste such code there
        Where "a" is your binary,
        "a_bruteforce" is binary of "stupid" and slow but right solution
        "check" is program that checks where output and ans are the same
        to run your script type "sh test.sh"
13 years ago, # |
  Vote: I like it +3 Vote: I do not like it
Ubuntu 11.02? o_O
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Are you read this post?