Блог пользователя DaurenMuratov

Автор DaurenMuratov, 13 лет назад, По-русски

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!

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

13 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится
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 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
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 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    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 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится
      can you explain how to use this code?
      • 13 лет назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится
        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 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится
Ubuntu 11.02? o_O
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Are you read this post?