Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

DaurenMuratov's blog

By DaurenMuratov, 15 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

15 years ago, hide # |
 
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" )
15 years ago, hide # |
 
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.
  • 15 years ago, hide # ^ |
     
    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>
    • 15 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it
      can you explain how to use this code?
      • 15 years ago, hide # ^ |
         
        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"
15 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it
Ubuntu 11.02? o_O
15 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
Are you read this post?