Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор canine, история, 5 часов назад, По-английски

hello all -- if you happen to be in the market for a new competitive programming extension and use VSCode, may i humbly suggest my new extension? i think it is relatively feature complete, but it's still in alpha (especially for languages other than C++) and may have some kinks that need working out. it theoretically supports C++, Java, Python, and Rust (and it's very easy to add more).

i created this because i was dissatisfied that most existing solutions can't import a bunch of test cases from a directory then run them in parallel. i also believe it has a cooler UI than other extensions. as usual, i didn't think it would take this long when i started...

if you encounter any difficulties, please let me know on github. thanks for taking a look!

hero image

Realtime Input/Output

unlike other test runners for VSCode, we let you use prewritten inputs and still interact with your program on the fly.

Input and Output Handling

Test Editor

extensive configuration and support for interactors and custom checkers (floating point is easy -- just use fcmp! thanks testlib).

Interactive Test

Stress Testing

run stress tests using a generator and brute force solution against your efficient solution. testlib is automatically included in generators/checkers/interactors.

Stress Testing

Debugging

debug with CodeLLDB / debugpy / the Java extension for VSCode. integrates with clangd to provide linting based on your compiler arguments.

Competitive Companion Integration

integrates with the Competitive Companion browser extension for one-click test imports.

note: you can't use Hightail's Competitive Companion integration while this extension is active (they bind to the same port).

File I/O and Directory Import

perfect for USACO!

website / visual studio marketplace / github

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

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

Please try it out, he didn't sleep for the last few weeks (also it has cool features and UI).

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

w extension

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

This extension gained me +300 elo, 4.0 gpa, and night vision

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

What VS code version does it need? I am in version 1.82.3 and it tells me the extension can not be installed with this version. Should i download a new vs code ?

  • »
    »
    4 часа назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    yes, the minimum vscode version is currently 1.91.1 !

    • »
      »
      »
      4 часа назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Thanks, i have successfully installed it. But there are some questions:

      • Does it have a light mode? Personally I can't stand dark mode :)
      • How to fill the settings? I cannot use it compile my code :)
      • »
        »
        »
        »
        4 часа назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        sorry, currently no light mode but i'll add that to the TODO! shouldn't be hard at all

        to fill out settings for the current workspace, you can open test editor, click on "select language," choose your language and the compiler & compile arguments fields should appear

        if you want to modify global settings (for all workspaces), for now you can edit those in the vscode settings UI, which you can access through test editor -> settings button with gear. you probably want to change "cpu: compiler," which should be a table with languages on the left and compiler on the right (blank is default)

        • »
          »
          »
          »
          »
          30 минут назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          I think i have completed the settings now, but it just tells me that Error compiling a.cpp: Failed to compile a.cpp :)

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

interesting

»
3 часа назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Can you elaborate on how you do stress testing? I understand the brute is just a slower brute solution which you can make pretty easily, but how do you create the generator?

  • »
    »
    50 минут назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    #include <bits/stdc++.h> using namespace std; int gen_int(int l, int r) { random_device rd; // Seed generator mt19937 gen(rd()); // Standard mersenne_twister_engine seeded with rd() uniform_int_distribution<> dis(l, r); // Distribution in range [l, r] return dis(gen); } int rand(int a, int b) { return gen_int(a , b ); } double getRandomDouble(double l, double r) { random_device rd; mt19937 gen(rd()); uniform_real_distribution<> dis(l, r); // Distribution in range [l, r] for double return dis(gen); } string generateRandomString(int length) { //const string charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; const string charset = "01"; string result; result.reserve(length); for (int i = 0; i < length; ++i) { result += charset[rand( 0 , charset.size() -1 )]; } return result; } vector<int> getRandomPermutation(int n) { vector<int> perm(n); for (int i = 0; i < n; ++i) { perm[i] = i + 1; } random_device rd; mt19937 gen(rd()); shuffle(perm.begin(), perm.end(), gen); return perm; } int main() { // random_shuffle(perm.begin() + 1, perm.end()); // create vector kima yji ! int n = rand (0 , 500 ) ; cout << n << endl ; return 0; }
»
49 минут назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

how to configure the interactor ?