GithubHelp home page GithubHelp logo

seriema / code-problems Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 836 KB

Trying out some code problems used in some university courses or competitions.

License: MIT License

JavaScript 94.15% Shell 5.85%

code-problems's Introduction

code-problems

Trying out some code problems used in some university courses or competitions.

I'll focus on:

Useful commands

At least for SPOJ I use these commands to test things out.

Note: It's assumed you're in the problem folder, e.g. SPOJ/DIVSUM. And that there exists a input.txt file with sample input data, and a expected.txt with matching output data that's expected if the program is correct.

Manual test: Check what the app outputs given input.txt as input.

$ ../run.sh

Simple auto-test: My regular work script. Pipe input.txt into app.js and check the results against expected.txt. Also saves the running time in time_test.txt.

$ ../test.sh

Simpler auto-test: My work script for problems where one input line matches one output line. Has nicer comparison table. Pipe input.txt into app.js and check the results against expected.txt, then output using column to get a input-output-expected table. Also saves the running time in time_test.txt.

$ ../test2.sh

Stress test: See if the app crashes due to too much input or large numbers. Also saves the running time in time_stress.txt.

$ ../stress.sh

Minify: Some problems require smaller source code and I don't want to sacrifice readability unnecessarily. Creates a app.min.js file and verifies that the program still works (using a simplified version of test.sh). Note: requires uglify-js to be installed and in PATH.

$ ../uglify.sh

Accepted answers

SPOJ

All in folder SPOJ/.

PROBLEM ID TIME MEM LANG DATE
TEST 14253161 0.04 65M NODEJS 2015-05-15
DIVSUM 14259035 2.16 119M NODEJS 2015-05-16
AMR10F 14308063 0.04 67M NODEJS 2015-05-23
FCTRL2 14677491 0.07 68M NODEJS 2015-07-16
ACODE 14679607 0.14 68M NODEJS 2015-07-16

Other answers

  • SPOJ/PRIME1 - did it before realizing that NODEJS wasn't an accepted lang.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.