{"id":24721926,"url":"https://github.com/debapriyo007/taking-io-java","last_synced_at":"2025-03-22T12:47:57.442Z","repository":{"id":274325563,"uuid":"922559615","full_name":"debapriyo007/Taking-IO-Java","owner":"debapriyo007","description":"This repository contains a Java program designed for competitive programming. It provides a basic structure for efficiently handling input and output .","archived":false,"fork":false,"pushed_at":"2025-01-26T15:35:20.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T16:27:31.333Z","etag":null,"topics":["boilerplate-template","bufferreader","cp","io","java"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/debapriyo007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-26T14:41:46.000Z","updated_at":"2025-01-26T15:35:23.000Z","dependencies_parsed_at":"2025-01-26T16:38:02.359Z","dependency_job_id":null,"html_url":"https://github.com/debapriyo007/Taking-IO-Java","commit_stats":null,"previous_names":["debapriyo007/taking-io-java"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debapriyo007%2FTaking-IO-Java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debapriyo007%2FTaking-IO-Java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debapriyo007%2FTaking-IO-Java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/debapriyo007%2FTaking-IO-Java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/debapriyo007","download_url":"https://codeload.github.com/debapriyo007/Taking-IO-Java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959448,"owners_count":20538626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate-template","bufferreader","cp","io","java"],"created_at":"2025-01-27T12:15:10.369Z","updated_at":"2025-03-22T12:47:57.422Z","avatar_url":"https://github.com/debapriyo007.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Competitive Programming I/O In Java\n\n\n\nThis repository contains a Java program designed for competitive programming. It provides a basic structure for efficiently handling input and output using custom classes (`InputReader` and `OutputWriter`) to streamline the problem-solving process during contests.\n\n## Table of Contents\n\n| Coding Platform                                                                                       |  Accepted |\n|---------------------------------------------------------------------------------------------|-----------------|\n| ![CodeChef](https://img.shields.io/badge/CodeChef-%23964B00.svg?style=for-the-badge\u0026logo=CodeChef\u0026logoColor=white) | ✅ Yes          |\n| ![Codeforces](https://img.shields.io/badge/Codeforces-445f9d?style=for-the-badge\u0026logo=Codeforces\u0026logoColor=white) | ✅ Yes          |\n\n\n\n\n## Features\n\n- **Custom Input Handling:**\n  - `InputReader` supports efficient reading of various data types such as `int`, `long`, `double`, and strings.\n  - Supports reading lines for custom input scenarios.\n\n- **Custom Output Handling:**\n  - `OutputWriter` enables fast and efficient output.\n  - Provides methods to write and writeLine for better control over the output.\n\n- **Error Handling:**\n  - Includes runtime exception handling for input/output operations.\n\n\n## Usage\n\n- Copy the bellow code and use it for competitive programming.\n- Accepted in any competitive programming platform.\n\n### Boilerplate Code\n\n```java\nimport java.util.*;\nimport java.io.*;\n\npublic class CompetitiveProgrammingSolution {\n\n    static class InputReader {\n        private BufferedReader reader;\n        private StringTokenizer tokenizer;\n\n        public InputReader() {\n            reader = new BufferedReader(new InputStreamReader(System.in));\n        }\n\n        public String next() {\n            while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n                try {\n                    tokenizer = new StringTokenizer(reader.readLine());\n                } catch (IOException e) {\n                    throw new RuntimeException(\"Error reading input\", e);\n                }\n            }\n            return tokenizer.nextToken();\n        }\n\n        public int nextInt() {\n            return Integer.parseInt(next());\n        }\n\n        public long nextLong() {\n            return Long.parseLong(next());\n        }\n\n        public double nextDouble() {\n            return Double.parseDouble(next());\n        }\n\n        public String readLine() {\n            String inputLine = \"\";\n            try {\n                inputLine = reader.readLine();\n            } catch (IOException e) {\n                throw new RuntimeException(\"Error reading line\", e);\n            }\n            return inputLine;\n        }\n    }\n\n    static class OutputWriter {\n        private BufferedWriter writer;\n\n        public OutputWriter() {\n            writer = new BufferedWriter(new OutputStreamWriter(System.out));\n        }\n\n        public void write(Object object) throws IOException {\n            writer.write(object.toString());\n        }\n\n        public void writeLine(Object object) throws IOException {\n            write(object);\n            writer.newLine();\n        }\n\n        public void close() throws IOException {\n            writer.close();\n        }\n    }\n\n    public static void main(String[] args) {\n        try {\n            InputReader inputReader = new InputReader();\n            OutputWriter outputWriter = new OutputWriter();\n\n            int T = inputReader.nextInt();\n            while (T -- \u003e 0) {\n               \n               // Solve the problem here\n               // Call the solveProblem method.\n            }\n            outputWriter.close();\n        } catch (Exception e) {\n            System.err.println(\"Error during program execution: \" + e.getMessage());\n        }\n    }\n\n}\n```\n\n1. **InputReader**: Handles reading input from the standard input.\n2. **OutputWriter**: Handles writing output to the standard output.\n3. **solveProblem**: The main logic for solving the competitive programming problem goes here.\n\n\n## Acknowledgments\n\n- Java community for the efficient `BufferedReader` and `BufferedWriter` classes.\n- Inspiration from competitive programming contests such as Codeforces, LeetCode, and HackerRank.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://media2.giphy.com/media/3O5Ae20Rc0yuzlAroL/200w.gif?cid=82a1493bheh8va1kfb4wgpkqkineb4gznte8i2vwtdwpqg8g\u0026ep=v1_gifs_related\u0026rid=200w.gif\u0026ct=s\" alt=\"alt text\"\u003e\n\u003c/p\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebapriyo007%2Ftaking-io-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebapriyo007%2Ftaking-io-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebapriyo007%2Ftaking-io-java/lists"}