Tips
New to competitive programming or WMOJ? Start here.
What is Competitive Programming?
Competitive programming is a sport where participants solve well-defined algorithmic problems under time constraints. You are given a problem statement, write code that reads input and produces the correct output, and submit it to an online judge that tests your solution against hidden test cases.
Problems typically involve data structures, algorithms, math, and logical reasoning. Solutions are evaluated on correctness (do all test cases pass?) and must run within the given time and memory limits.
How WMOJ Works
Problems: Browse practice problems from the /problems page. Each problem has a point value, a time limit, and a memory limit.
Submitting: Click "Solve" on any problem, write your solution in Python, C++, or Java, and submit. The judge compiles and runs your code against all test cases and reports the results instantly.
Contests: Join timed contests from the /contests page. Your countdown starts when you join. Solve as many problems as possible before time runs out.
Points: Each problem you solve earns you points. Your total score is calculated using a weighted formula that rewards solving harder (higher-point) problems. Check the leaderboard at /users to see where you rank.
Getting Started
- Create an account or log in.
- Head to the /problems page and pick an easy problem to start with.
- Read the problem statement carefully, paying attention to input/output format.
- Write your solution, test it locally if you can, then submit.
- If your solution doesn't pass all test cases, check edge cases and try again.
General Tips
- Read the problem constraints carefully — they hint at the expected time complexity.
- Start with brute-force, then optimize if needed.
- Watch out for integer overflow in C++ and Java. Use long long or long when values exceed 2 billion.
- In Python, use sys.stdin for faster input on large test cases.
- Test edge cases: empty input, maximum values, single-element cases.
- If you get "Time Limit Exceeded", your algorithm is likely too slow — think about a more efficient approach.
