Comments (11)
it is almost impossible to generate all the answers in the testing function since the number might be very large.
Agree. And the only way (I think) to test this problem is to write code that will test your output according to the input which is similar to stress-testing and testing interactive problems.
We need an interactor which will do the following:
- generate random test cases
- receive the output of the solution
- validate the output according to the input
from competitest.nvim.
Assign a function to output_compare_method
(see configuration for further details).
In this case it's likely you want to use local configuration
from competitest.nvim.
Not really. For example, a problem asks to print out the shortest path from to node to another. Since there might be more than one path that are shortest, the sample output only prints one of them. Can Competitest check this multiple answer-problem in this case?
from competitest.nvim.
What if output_compare_method
accepted three arguments: output, expected output and input?
So you could write a function to check the correctness of your solution.
from competitest.nvim.
What I think is that programmers using the plugins usually compete in online contest like Codeforces, where it is not convenient to write the output checking function since the contest is very time-sensitive. Is there any solution?
from competitest.nvim.
One possible solution I can think of is to create a server for programmers to "not actually" submit to check their output (like creating a dummy user on Codeforces and let coders submit through that user, but the plugin should only check for the sample test cases, not the hidden test cases on Codeforces). This is easier to utilize the output checking function that has been written before by testers.
from competitest.nvim.
I could add a way to store more than one answer in a testcase, so that a testcase is correct when output matches one of the provided expected outputs.
This can be already done with a workaround
- Put a special character like
|
between possible answers when writing expected output - In
output_compare_method
splitexpected_output
into a list, using the special character as separator - Check if
output
belongs to the list
One possible solution I can think of is to create a server for programmers to "not actually" submit to check their output (like creating a dummy user on Codeforces and let coders submit through that user, but the plugin should only check for the sample test cases, not the hidden test cases on Codeforces).
This is unlikely, and probably dummy users aren't allowed on many competitive programming platforms.
This is easier to utilize the output checking function that has been written before by testers.
A better way would be to use a checker function provided by testers, though I don't know if they're available during a contest.
from competitest.nvim.
I think it's nearly impossible to generate all answers to put into the checker during contest.
from competitest.nvim.
like creating a dummy user on Codeforces and let coders submit through that user
Some platforms do this such as vjudge but this won't work in running contests because your submitted code will be first submitted by this dummy user and if you submitted it again you will be marked as a cheater.
I don't think we can implement this feature in the way you want (automated). A manual test code should be written. I also believe that this feature is related to interactive problems and stress testing. We can try to implement 3 features with the same effort. @xeluxee what do you think?
from competitest.nvim.
This is the current script I use to test interactive problems. I also noticed that I can use it to stress-test problems and make it a more generalized script abandoning the other bash script I used to use for stress testing.
from competitest.nvim.
Testing interactive problems is also a feature to be added. But what I meant was that in problems where more than 1 answers are valid (e.g That might be multiple path from source to sink with the shortest length), it is almost impossible to generate all the answers in the testing function since the number might be very large.
from competitest.nvim.
Related Issues (20)
- unable to recieve test case HOT 1
- unable to recieve test case from CodeforcesContestHelper HOT 1
- Commands Are Not Found!!! HOT 6
- Running :CompetiTest commands throw `trailing data in msgpack string` error HOT 2
- Whitespaces not compiled correctly. HOT 3
- Unable to get compile directory working HOT 2
- Status Line Integration HOT 2
- Template file is not used when received problems path is set to a function HOT 5
- CompetiTest receive only gets 1 testcase. HOT 1
- Run "require('competitest').setup() -- to use default configuration" HOT 1
- Why my `template_file` doesn't work when receive a contest ? HOT 2
- [Feature Request] read all testcases in the testcase directory HOT 1
- Submitting solution to the respective competitive programming platform HOT 1
- Some idea concerning new features HOT 4
- Space in file name when receiving problem HOT 1
- Receive problems confusion
- Feature request: allow user to choose whether to create a new source file or to just stay in current source file.
- Issue with nui.nvim when recieving contest problems
- When there exists another solution file created before, the default behavior should not be 'overwrite the old file' but 'keep the old file'
- Uncorrectly parsing problems containing slashes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from competitest.nvim.