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

Автор nhivd, история, 8 лет назад, По-английски

Hi everyone! I have a testcases include a lot of tests (example 1.in/1.out,...). But I do not know how to write a script (or a program with C++ or any language) to test my testcases. If you know how to do it, hope you will help me! Thank you.

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

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I use https://ideone.com/88FCXo to generate the outputs for all input files. You can throw in a diff command to compare the output files.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

You can check out this mini-grader bash script made by marsenis. It is very easy to use.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

I use very simple script on python to run exe-file on many tests. It can be easily modified, hope it will help you. Link

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -37 Проголосовать: не нравится

But I do not know how to write a script (or a program with C++ or any language) to test my testcases.

LooOoLoOoooOoLoOooOoOoOoL. ROFL. LMAO. How have you been trying to learn "programming"? Have you written so much unreadable code to solve unrealistic problems that you cannot even write a simple program to solve a trivial problem?

  • »
    »
    8 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +10 Проголосовать: не нравится

    You think it a simple trivial problem? Can you give me your code to test a testcases? Your code have to annouce all results such as accepts, time run, run time error or anything else like an online judge?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

https://github.com/convict-git/.vimrc/blob/master/compile
It's a shell script. Save it as /usr/bin/compile Make a folder for every problem you solve. And save the inputs as input1, input2, .... and outputs as output1, output2, ... And whenever you want to run your code against these test cases,
compile [cppfile] [allowed run time]
eg. compile sol.cpp 1

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

you can use polygon

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Khủng