All CCC questions were accessed through DMOJ
Computer Science Club at Glenforest Secondary School.
Club resources can be found here.
- USACO GUIDE
- Competitive programming Handbook All Credits goes to the original author of the book
Antti Laaksonen. - Algorithms Every Algorithm you'll ever need
We welcome contributions to this repository! To ensure a smooth process, please follow these guidelines (ensure you have git installed)
-
Fork the Repository: Click the "Fork" button at the top right of the repository page to create a copy of the repository on your GitHub account.
-
Clone the Repository: Clone the forked repository to your local machine using the following command:
git clone https://github.com/GFSSCompSci/CCC-Solutions.git
-
Create a New Branch: Create a new branch for your feature or bug fix:
git checkout -b feature-branch-name
-
Make Changes: Make your changes to the codebase. Ensure your code follows the project's coding standards and includes appropriate comments and documentation.
-
Commit Changes: Commit your changes with a descriptive commit message:
git add . git commit -m "Description of the changes made"
-
Push Changes: Push your changes to your forked repository:
git push origin feature-branch-name
-
Create a Pull Request: Go to the original repository and create a pull request from your forked repository. Provide a clear and detailed description of your changes.
When solving competitive programming problems, it's often necessary to handle large inputs efficiently. In python the built-in input() function can be slow for large inputs, so it's recommended to use sys.stdin.readline for faster input.
Here's how you can use it
-
Import the
sysmodule:import sys
-
Read a single line of input:
line = sys.stdin.readline().strip()
sys.stdin.readline()reads a line from standard input..strip()removes any trailing newline characters.
-
Read multiple lines of input:
import sys input = sys.stdin.read data = input().split()
sys.stdin.read()reads all input at once..split()splits the input into a list of strings based on whitespace.
-
Example:
import sys input = sys.stdin.readline n = int(input().strip()) arr = list(map(int, input().strip().split())) print(n) print(arr)