Last active
October 3, 2025 09:07
-
-
Save toxdes/0c846c210701c08dae4a6e78d6939c5d to your computer and use it in GitHub Desktop.
Java templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### added by cp-setup script - start | |
| export PS1='\[\e[0;34m\][DO HARD THINGS] \[\e[0;33m\]\W\[\e[0m\] \[\e[0;31m\]⚡\[\e[0m\] ' | |
| alias cph="python3 $HOME/cp/cph.py &" | |
| ccp() { | |
| [ -f "Main.java" ] || { echo "Main.java not found"; return 1; } | |
| local dir="${1%/*}" | |
| local name="${1##*/}" | |
| if [ "$1" != *"/"* ]; then | |
| dir="misc" | |
| name="$1" | |
| fi | |
| dir="$HOME/contests/$dir" | |
| mkdir -p "$dir" | |
| local dest_path="$dir/$name.java" | |
| local count=1 | |
| while [ -f "$dest_path" ]; do | |
| count=$((count + 1)) | |
| dest_path="$dir/$name-$count.java" | |
| done | |
| cp "Main.java" "$dest_path" | |
| echo "Copied to $dest_path" | |
| } | |
| jr() { | |
| javac Main.java || return 1 | |
| local timeout_sec="0.5s" | |
| if [ "$1" == "-a" ]; then | |
| shift | |
| for file in in*; do | |
| if [ -f "$file" ]; then | |
| local i | |
| if [ "$file" == "in" ]; then | |
| i=1 | |
| else | |
| i=${file//[^0-9]/} | |
| fi | |
| echo -e "\x1B[33m--- TEST #$i ---\x1B[0m" | |
| URMOM=1 java -ea -classpath . Main < "$file" | |
| fi | |
| done | |
| elif [ "$1" == "-c" ]; then | |
| shift | |
| (pbpaste 2>/dev/null || xclip -selection clipboard -o 2>/dev/null || wl-paste 2>/dev/null) | URMOM=1 java -ea -classpath . Main "$@" | |
| else | |
| URMOM=1 java -ea -classpath . Main "$@" | |
| fi | |
| } | |
| ### added by cp-setup script - end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import sys | |
| import re | |
| def comment_file(file_path): | |
| """ | |
| Comments out err.e and err.ef statements in a Java file. | |
| """ | |
| try: | |
| with open(file_path, 'r') as f: | |
| lines = f.readlines() | |
| except FileNotFoundError: | |
| print(f"Error: File not found at {file_path}") | |
| sys.exit(1) | |
| new_lines = [] | |
| in_err_block = False | |
| paren_level = 0 | |
| for line in lines: | |
| stripped_line = line.strip() | |
| if stripped_line.startswith('//'): | |
| new_lines.append(line) | |
| continue | |
| if not in_err_block: | |
| match = re.search(r'\b(err\.(?:e|ef))\s*\(', line) | |
| if match: | |
| in_err_block = True | |
| new_lines.append('//~' + line) | |
| paren_level += line.count('(') | |
| paren_level -= line.count(')') | |
| if paren_level == 0 and ';' in line[match.end():]: | |
| in_err_block = False | |
| else: | |
| new_lines.append(line) | |
| else: | |
| new_lines.append('//~' + line) | |
| paren_level += line.count('(') | |
| paren_level -= line.count(')') | |
| if paren_level == 0 and ';' in line: | |
| in_err_block = False | |
| with open(file_path, 'w') as f: | |
| f.writelines(new_lines) | |
| print(f"Commented out err statements in {file_path}") | |
| def uncomment_file(file_path): | |
| """ | |
| Uncomments lines that were previously commented out by this script. | |
| """ | |
| try: | |
| with open(file_path, 'r') as f: | |
| lines = f.readlines() | |
| except FileNotFoundError: | |
| print(f"Error: File not found at {file_path}") | |
| sys.exit(1) | |
| new_lines = [] | |
| for line in lines: | |
| if line.lstrip().startswith('//~') or line.lstrip().startswith('// ~'): | |
| new_lines.append(re.sub(r'//\s*~', '', line, count=1)) | |
| else: | |
| new_lines.append(line) | |
| with open(file_path, 'w') as f: | |
| f.writelines(new_lines) | |
| print(f"Uncommented lines in {file_path}") | |
| def main(): | |
| """ | |
| Main function to parse command-line arguments. | |
| """ | |
| if len(sys.argv) != 3: | |
| print("Usage: python comment.py <comment|uncomment> <file_path>") | |
| sys.exit(1) | |
| subcommand = sys.argv[1] | |
| file_path = sys.argv[2] | |
| if subcommand == "comment": | |
| comment_file(file_path) | |
| elif subcommand == "uncomment": | |
| uncomment_file(file_path) | |
| else: | |
| print(f"Error: Unknown subcommand '{subcommand}'") | |
| print("Usage: python comment.py <comment|uncomment> <file_path>") | |
| sys.exit(1) | |
| if __name__ == "__main__": | |
| main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import sys | |
| import os | |
| import http.server | |
| import json | |
| import platform | |
| import subprocess | |
| import glob | |
| log_file_path = os.path.expanduser('~/cp/.cph-logs.txt') | |
| log_file = open(log_file_path, 'w') | |
| sys.stdout = log_file | |
| sys.stderr = log_file | |
| class CompetitiveCompanionHandler(http.server.BaseHTTPRequestHandler): | |
| """ | |
| A custom HTTP request handler for the Competitive Companion server. | |
| """ | |
| def _send_cors_headers(self): | |
| """Sends headers to allow cross-origin requests.""" | |
| self.send_header('Access-Control-Allow-Origin', '*') | |
| self.send_header('Access-Control-Allow-Methods', 'POST, OPTIONS') | |
| self.send_header('Access-Control-Allow-Headers', 'Content-Type') | |
| def do_OPTIONS(self): | |
| """Handles pre-flight CORS requests.""" | |
| self.send_response(204) | |
| self._send_cors_headers() | |
| self.end_headers() | |
| def do_GET(self): | |
| """Handles GET requests, serving a simple status message.""" | |
| self.send_response(200) | |
| self.send_header('Content-type', 'text/html') | |
| self.end_headers() | |
| self.wfile.write(b"Competitive Companion server is running. Send POST requests with test case data.") | |
| def do_POST(self): | |
| """ | |
| Handles POST requests from Competitive Companion. | |
| Parses test cases and writes them to 'in', 'in2', 'in3', etc. | |
| """ | |
| try: | |
| content_length = int(self.headers['Content-Length']) | |
| post_data = self.rfile.read(content_length) | |
| data = json.loads(post_data) | |
| try: | |
| name = data.get('name') | |
| system = platform.system() | |
| if system == 'Darwin': | |
| subprocess.run(['osascript', '-e', f'display notification "✅ CPH - Parsed problem {name}" with title "Competitive Programming Helper"']) | |
| elif system == 'Linux': | |
| subprocess.run(['notify-send', '✅ CPH', f'Parsed problem {name}']) | |
| except Exception: | |
| pass | |
| test_cases = data.get('tests', []) | |
| for f in glob.glob('in') + glob.glob('in[0-9]*'): | |
| os.remove(f) | |
| for i, test_case in enumerate(test_cases): | |
| if i == 0: | |
| filename = 'in' | |
| else: | |
| filename = f'in{i + 1}' | |
| input_content = test_case.get('input', '') | |
| with open(filename, 'w', encoding='utf-8') as f: | |
| f.write(input_content) | |
| print(f"Successfully wrote test case to {filename}") | |
| self.send_response(200) | |
| self.send_header('Content-type', 'application/json') | |
| self._send_cors_headers() | |
| self.end_headers() | |
| self.wfile.write(json.dumps({'status': 'success', 'message': f'{len(test_cases)} test cases received.'}).encode('utf-8')) | |
| except json.JSONDecodeError: | |
| self.send_response(400) | |
| self.send_header('Content-type', 'application/json') | |
| self._send_cors_headers() | |
| self.end_headers() | |
| self.wfile.write(json.dumps({'status': 'error', 'message': 'Bad Request: Invalid JSON.'}).encode('utf-8')) | |
| except Exception as e: | |
| self.send_response(500) | |
| self.send_header('Content-type', 'application/json') | |
| self._send_cors_headers() | |
| self.end_headers() | |
| self.wfile.write(json.dumps({'status': 'error', 'message': f'Internal Server Error: {e}'}).encode('utf-8')) | |
| def run(server_class=http.server.HTTPServer, handler_class=CompetitiveCompanionHandler, port=10045): | |
| """ | |
| Starts the HTTP server on the specified port. | |
| """ | |
| server_address = ('', port) | |
| httpd = server_class(server_address, handler_class) | |
| print(f"Starting Competitive Companion server on port {port}...") | |
| print("Listening for test cases from the Competitive Companion browser extension.") | |
| try: | |
| httpd.serve_forever() | |
| except KeyboardInterrupt: | |
| httpd.server_close() | |
| if __name__ == '__main__': | |
| # 10045 is the default port for Competitive Companion. | |
| try: | |
| run() | |
| finally: | |
| log_file.close() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package templates; | |
| import java.util.*; | |
| class Dijkstra { | |
| static class Pair { | |
| int x; | |
| long y; | |
| Pair(int x, long y) { | |
| this.x = x; | |
| this.y = y; | |
| } | |
| @Override | |
| public String toString() { | |
| return String.format("(%d, %d)", x, y); | |
| } | |
| } | |
| ArrayList<ArrayList<Pair>> adj; | |
| long[] d; | |
| int[] par; | |
| public static final long INF = (long)1e18; | |
| public Dijkstra(int n) { | |
| adj = new ArrayList<>(); | |
| for (int i = 0; i < n; ++i) { | |
| adj.add(new ArrayList<Pair>()); | |
| } | |
| d = new long[n]; | |
| par = new int[n]; | |
| } | |
| public void addEdge(int u, int v, long w) { | |
| --u; | |
| --v; | |
| adj.get(u).add(new Pair(v, w)); | |
| adj.get(v).add(new Pair(u, w)); | |
| } | |
| public void reset() { | |
| Arrays.fill(d, INF); | |
| Arrays.fill(par, -1); | |
| } | |
| public long[] run(int source) { | |
| reset(); | |
| --source; | |
| PriorityQueue<Pair> q = new PriorityQueue<Pair>((a, b) -> { | |
| if (b.y == a.y) { | |
| return b.x - a.x; | |
| } | |
| return b.y == a.y ? 0 : b.y < a.y ? 1 : -1; | |
| }); | |
| d[source] = 0; | |
| q.add(new Pair(source, 0)); | |
| while (!q.isEmpty()) { | |
| Pair c = q.poll(); | |
| if (c.y != d[c.x]) | |
| continue; | |
| for (Pair p : adj.get(c.x)) { | |
| int v = p.x; | |
| long w = p.y; | |
| if (d[c.x] + w < d[v]) { | |
| d[v] = d[c.x] + w; | |
| par[v] = c.x; | |
| q.add(new Pair(v, d[v])); | |
| } | |
| } | |
| } | |
| return Arrays.copyOf(d, d.length); | |
| } | |
| public List<Integer> getPath(int s, int t) { | |
| ArrayList<Integer> path = new ArrayList<Integer>(); | |
| --s; | |
| --t; | |
| int c = t; | |
| while (c != s) { | |
| path.add(c + 1); | |
| c = par[c]; | |
| } | |
| path.add(s + 1); | |
| Collections.reverse(path); | |
| return path; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package templates; | |
| import java.util.*; | |
| class DSU { | |
| int n; | |
| int[] par; | |
| int sz; | |
| public DSU(int n) { | |
| this.n = n; | |
| this.par = new int[n]; | |
| this.sz = 0; | |
| reset(); | |
| } | |
| public void reset() { | |
| for (int i = 0; i < n; ++i) { | |
| par[i] = i; | |
| } | |
| sz = n; | |
| } | |
| private int find(int x) { | |
| if (x == par[x]) | |
| return x; | |
| return par[x] = find(par[x]); | |
| } | |
| public void union(int x, int y) { | |
| x = find(x); | |
| y = find(y); | |
| if(x != y)--sz; | |
| par[x] = y; | |
| } | |
| public boolean same(int x, int y) { | |
| return find(x) == find(y); | |
| } | |
| public int uniq() { | |
| return sz; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
| <profiles version="20"> | |
| <profile kind="CodeFormatterProfile" name="JavaConventions" version="20"> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/> | |
| <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> | |
| <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/> | |
| <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_record_components" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_if_single_item"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/> | |
| <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_if_empty"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_never"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="1"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_if_single_item"/> | |
| <setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_if_empty"/> | |
| <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_if_single_item"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value="one_line_if_empty"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_never"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/> | |
| <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_never"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="8"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_never"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value="one_line_if_empty"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_assertion_message" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_if_single_item"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="0"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="mixed"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/> | |
| <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/> | |
| <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/> | |
| <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/> | |
| </profile> | |
| </profiles> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "template": { | |
| "prefix": "qw", | |
| "scope": "java", | |
| "body": [ | |
| "import java.util.*;", | |
| "import java.io.*;", | |
| "", | |
| "public class Main {", | |
| " static InputStream inputStream;", | |
| " static OutputStream outputStream;", | |
| " static InputReader in;", | |
| " static PrintWriter out;", | |
| " static Random random;", | |
| " static String PROB_NAME = \"\";", | |
| " static final int ENABLE_ERR = 1;", | |
| "", | |
| " ///////////////////////////////////////", | |
| " // solution", | |
| " ///////////////////////////////////////", | |
| " static final int MULTIPLE_TESTCASES = 1;", | |
| "", | |
| " private static void precompute() {}", | |
| "", | |
| " static class Solution {", | |
| " public void solve(int tc) throws IOException {", | |
| " $1", | |
| " }", | |
| " }", | |
| "", | |
| " ///////////////////////////////////////", | |
| " // template", | |
| " ///////////////////////////////////////", | |
| " public static void main(String[] args) throws IOException {", | |
| " inputStream = System.in;", | |
| " outputStream = System.out;", | |
| " random = new Random();", | |
| " if (PROB_NAME != \"\") {", | |
| " inputStream = new FileInputStream(new File(PROB_NAME + \".in\"));", | |
| " outputStream = new FileOutputStream(new File(PROB_NAME + \".out\"));", | |
| " }", | |
| " in = new InputReader(inputStream);", | |
| " out = new PrintWriter(outputStream);", | |
| " int tc = 1;", | |
| " if (MULTIPLE_TESTCASES > 0)", | |
| " tc = in.ni();", | |
| " precompute();", | |
| " Solution sol = new Solution();", | |
| " for (int i = 1; i <= tc; ++i) {", | |
| " sol.solve(i);", | |
| " }", | |
| " in.close();", | |
| " out.close();", | |
| " }", | |
| "", | |
| " static class InputReader {", | |
| " BufferedReader reader;", | |
| " StringTokenizer st;", | |
| "", | |
| " public InputReader(InputStream in) {", | |
| " reader = new BufferedReader(new InputStreamReader(in));", | |
| " st = null;", | |
| " }", | |
| "", | |
| " public String ns() throws IOException {", | |
| " while (st == null || !st.hasMoreTokens()) {", | |
| " st = new StringTokenizer(reader.readLine());", | |
| " }", | |
| " return st.nextToken();", | |
| " }", | |
| "", | |
| " public Long nl() throws IOException {", | |
| " return Long.parseLong(ns());", | |
| " }", | |
| "", | |
| " public Integer ni() throws IOException {", | |
| " return Integer.parseInt(ns());", | |
| " }", | |
| "", | |
| " public int[] nia(int n) throws IOException {", | |
| " int[] a = new int[n];", | |
| " for (int i = 0; i < n; ++i) {", | |
| " a[i] = ni();", | |
| " }", | |
| " return a;", | |
| " }", | |
| "", | |
| " public long[] nla(int n) throws IOException {", | |
| " long[] a = new long[n];", | |
| " for (int i = 0; i < n; ++i) {", | |
| " a[i] = nl();", | |
| " }", | |
| " return a;", | |
| " }", | |
| "", | |
| " public void close() throws IOException {", | |
| " reader.close();", | |
| " }", | |
| " }", | |
| "", | |
| " static class err {", | |
| " static boolean ok = false;", | |
| " static {", | |
| " try {", | |
| " ok = System.getenv(\"URMOM\") != null;", | |
| " } catch (Exception e) {", | |
| " ok = false;", | |
| " }", | |
| " }", | |
| "", | |
| " public static void ef(String format, Object... args) {", | |
| " if (ok && ENABLE_ERR == 1) {", | |
| " out.print(\"\\u001B[31m\");", | |
| " out.printf(format, args);", | |
| " out.print(\"\\u001B[0m\");", | |
| " }", | |
| " }", | |
| "", | |
| " public static void e(String s) {", | |
| " if (ok && ENABLE_ERR == 1) {", | |
| " out.print(\"\\u001B[31m\");", | |
| " out.println(s);", | |
| " out.print(\"\\u001B[0m\");", | |
| " }", | |
| " }", | |
| " }", | |
| "}", | |
| "" | |
| ], | |
| "description": "template" | |
| }, | |
| "dijkstra": { | |
| "scope": "java", | |
| "prefix": "qdij", | |
| "body": [ | |
| "class Dijkstra {", | |
| " static class Pair {", | |
| " int x;", | |
| " long y;", | |
| "", | |
| " Pair(int x, long y) {", | |
| " this.x = x;", | |
| " this.y = y;", | |
| " }", | |
| "", | |
| " @Override ", | |
| " public String toString() {", | |
| " return String.format(\"(%d, %d)\", x, y);", | |
| " }", | |
| " }", | |
| "", | |
| " ArrayList<ArrayList<Pair>> adj;", | |
| " long[] d;", | |
| " int[] par;", | |
| " public static final long INF = (long)1e18;", | |
| "", | |
| " public Dijkstra(int n) {", | |
| " adj = new ArrayList<>();", | |
| " for (int i = 0; i < n; ++i) {", | |
| " adj.add(new ArrayList<Pair>());", | |
| " }", | |
| " d = new long[n];", | |
| " par = new int[n];", | |
| " }", | |
| "", | |
| " public void addEdge(int u, int v, long w) {", | |
| " --u;", | |
| " --v;", | |
| " adj.get(u).add(new Pair(v, w));", | |
| " adj.get(v).add(new Pair(u, w));", | |
| " }", | |
| "", | |
| " public void reset() {", | |
| " Arrays.fill(d, INF);", | |
| " Arrays.fill(par, -1);", | |
| " }", | |
| "", | |
| " public long[] run(int source) {", | |
| " reset();", | |
| " --source;", | |
| " PriorityQueue<Pair> q = new PriorityQueue<Pair>((a, b) -> {", | |
| " if (b.y == a.y) {", | |
| " return b.x - a.x;", | |
| " }", | |
| " return b.y == a.y ? 0 : b.y < a.y ? 1 : -1;", | |
| " });", | |
| " d[source] = 0;", | |
| " q.add(new Pair(source, 0));", | |
| " while (!q.isEmpty()) {", | |
| " Pair c = q.poll();", | |
| " if (c.y != d[c.x])", | |
| " continue;", | |
| " for (Pair p : adj.get(c.x)) {", | |
| " int v = p.x;", | |
| " long w = p.y;", | |
| " if (d[c.x] + w < d[v]) {", | |
| " d[v] = d[c.x] + w;", | |
| " par[v] = c.x;", | |
| " q.add(new Pair(v, d[v]));", | |
| " }", | |
| " }", | |
| " }", | |
| " return Arrays.copyOf(d, d.length);", | |
| " }", | |
| "", | |
| " public List<Integer> getPath(int s, int t) {", | |
| " ArrayList<Integer> path = new ArrayList<Integer>();", | |
| " --s;", | |
| " --t;", | |
| " int c = t;", | |
| " while (c != s) {", | |
| " path.add(c + 1);", | |
| " c = par[c];", | |
| " }", | |
| " path.add(s + 1);", | |
| " Collections.reverse(path);", | |
| " return path;", | |
| " }", | |
| "}", | |
| "" | |
| ], | |
| "description": "dijkstra" | |
| }, | |
| "dsu": { | |
| "scope": "java", | |
| "prefix": "qdsu", | |
| "body": [ | |
| "class DSU {", | |
| " int n;", | |
| " int[] par;", | |
| "", | |
| " public DSU(int n) {", | |
| " this.n = n;", | |
| " this.par = new int[n];", | |
| " reset();", | |
| " }", | |
| "", | |
| " public void reset() {", | |
| " for (int i = 0; i < n; ++i) {", | |
| " par[i] = i;", | |
| " }", | |
| " }", | |
| "", | |
| " private int find(int x) {", | |
| " if (x == par[x])", | |
| " return x;", | |
| " return par[x] = find(par[x]);", | |
| " }", | |
| "", | |
| " public void union(int x, int y) {", | |
| " x = find(x);", | |
| " y = find(y);", | |
| " par[x] = y;", | |
| " }", | |
| "", | |
| " public boolean same(int x, int y) {", | |
| " return find(x) == find(y);", | |
| " }", | |
| "", | |
| " public int uniq() {", | |
| " HashSet<Integer> S = new HashSet<Integer>();", | |
| " for (int i = 0; i < n; ++i) {", | |
| " S.add(find(i));", | |
| " }", | |
| " return S.size();", | |
| " }", | |
| "}" | |
| ], | |
| "description": "dsu" | |
| }, | |
| "mod": { | |
| "prefix": "qmod", | |
| "scope": "java", | |
| "body": [ | |
| "final class Mod {", | |
| " public static final long M = (long) 1e9 + 7;", | |
| " public static long[] F, invF;", | |
| " private static boolean generated = false;", | |
| " private static int maxN = 0;", | |
| "", | |
| " public static long add(long a, long b) {", | |
| " long res = (a + b) % M;", | |
| " return res < 0 ? res + M : res;", | |
| " }", | |
| "", | |
| " public static long sub(long a, long b) {", | |
| " long res = (a - b) % M;", | |
| " return res < 0 ? res + M : res;", | |
| " }", | |
| "", | |
| " public static long mul(long a, long b) {", | |
| " return ((a % M) * (b % M)) % M;", | |
| " }", | |
| "", | |
| " public static long div(long a, long b) {", | |
| " return mul(a, inv(b));", | |
| " }", | |
| "", | |
| " public static long inv(long a) {", | |
| " return pow(a, M - 2);", | |
| " }", | |
| "", | |
| " public static long pow(long a, long b) {", | |
| " long res = 1;", | |
| " a %= M;", | |
| " while (b > 0) {", | |
| " if ((b & 1) == 1) {", | |
| " res = mul(res, a);", | |
| " }", | |
| " a = mul(a, a);", | |
| " b >>= 1;", | |
| " }", | |
| " return res;", | |
| " }", | |
| "", | |
| " public static void genFact(int n) {", | |
| " if (generated && n <= maxN)", | |
| " return;", | |
| "", | |
| " int N = n + 1;", | |
| " F = new long[N];", | |
| " invF = new long[N];", | |
| "", | |
| " F[0] = 1L;", | |
| " for (int i = 1; i < N; i++) {", | |
| " F[i] = mul(F[i - 1], i);", | |
| " }", | |
| "", | |
| " invF[N - 1] = inv(F[N - 1]);", | |
| " for (int i = N - 2; i >= 0; i--) {", | |
| " invF[i] = mul(invF[i + 1], i + 1);", | |
| " }", | |
| "", | |
| " generated = true;", | |
| " maxN = N - 1;", | |
| " }", | |
| "", | |
| " public static long fact(int n) {", | |
| " if (!generated || n > maxN) {", | |
| " throw new IllegalArgumentException(\"Call genFact(\" + n + \") first\");", | |
| " }", | |
| " return F[n];", | |
| " }", | |
| "", | |
| " public static long invFact(int n) {", | |
| " if (!generated || n > maxN) {", | |
| " throw new IllegalArgumentException(\"Call genFact(\" + n + \") first\");", | |
| " }", | |
| " return invF[n];", | |
| " }", | |
| "", | |
| " public static long C(int n, int r) {", | |
| " if (!generated || n > maxN) {", | |
| " throw new IllegalArgumentException(\"Call genFact(\" + n + \") first\");", | |
| " }", | |
| " if (r < 0 || r > n)", | |
| " return 0;", | |
| " return mul(F[n], mul(invF[r], invF[n - r]));", | |
| " }", | |
| "}", | |
| "" | |
| ], | |
| "description": "Modular Arithmetic operations" | |
| }, | |
| "reverse": { | |
| "scope": "java", | |
| "prefix": "qrev", | |
| "body": [ | |
| "private void rev($1[] a) {", | |
| " for (int l = 0, r = a.length - 1; l < r; l++, r--) {", | |
| " $1 t = a[l];", | |
| " a[l] = a[r];", | |
| " a[r] = t;", | |
| " }", | |
| "}" | |
| ], | |
| "description": "reverse" | |
| }, | |
| "shuffle": { | |
| "scope": "java", | |
| "prefix": "qshuf", | |
| "body": [ | |
| "private void shuf($1[] a) {", | |
| " java.util.Random random = new java.util.Random();", | |
| " for (int i = a.length - 1; i > 0; --i) {", | |
| " int x = random.nextInt(i + 1);", | |
| " $1 t = a[x];", | |
| " a[x] = a[i];", | |
| " a[i] = t;", | |
| " }", | |
| "}" | |
| ], | |
| "description": "shuffle" | |
| }, | |
| "power": { | |
| "prefix": "qpow", | |
| "scope": "java", | |
| "body": [ | |
| " public final long pow(long b, long p) {", | |
| " if (p == 0)", | |
| " return 1;", | |
| " if (p == 1)", | |
| " return b;", | |
| " long half = pow(b, p / 2);", | |
| " if (p % 2 == 1) {", | |
| " return half * half * b;", | |
| " }", | |
| " return half * half;", | |
| " }" | |
| ], | |
| "description": "power" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "key": "ctrl+alt+o", | |
| "command": "-workbench.action.remote.showMenu" | |
| }, | |
| { | |
| "key": "ctrl+alt+o", | |
| "command": "workbench.action.files.openFolderViaWorkspace", | |
| "when": "!openFolderWorkspaceSupport && workbenchState == 'workspace'" | |
| }, | |
| { | |
| "key": "ctrl+o", | |
| "command": "-workbench.action.files.openFolderViaWorkspace", | |
| "when": "!openFolderWorkspaceSupport && workbenchState == 'workspace'" | |
| }, | |
| { | |
| "key": "ctrl+alt+o", | |
| "command": "workbench.action.files.openFileFolder", | |
| "when": "isMacNative && openFolderWorkspaceSupport" | |
| }, | |
| { | |
| "key": "ctrl+o", | |
| "command": "-workbench.action.files.openFileFolder", | |
| "when": "isMacNative && openFolderWorkspaceSupport" | |
| }, | |
| { | |
| "key": "ctrl+alt+o", | |
| "command": "workbench.action.files.openFile", | |
| "when": "true" | |
| }, | |
| { | |
| "key": "ctrl+o", | |
| "command": "-workbench.action.files.openFile", | |
| "when": "true" | |
| }, | |
| { | |
| "key": "ctrl+o", | |
| "command": "workbench.action.files.openFolder", | |
| "when": "openFolderWorkspaceSupport" | |
| }, | |
| { | |
| "key": "ctrl+k ctrl+o", | |
| "command": "-workbench.action.files.openFolder", | |
| "when": "openFolderWorkspaceSupport" | |
| }, | |
| { | |
| "key": "ctrl+'", | |
| "command": "workbench.action.tasks.build", | |
| "when": "taskCommandsRegistered" | |
| }, | |
| { | |
| "key": "ctrl+-", | |
| "command": "workbench.action.tasks.runTask", | |
| "when": "taskCommandsRegistered", | |
| "args": "remove debug statements" | |
| }, | |
| { | |
| "key": "ctrl+shift+-", | |
| "command": "workbench.action.tasks.runTask", | |
| "when": "taskCommandsRegistered", | |
| "args": "undo remove debug statements" | |
| }, | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package templates; | |
| final class Mod { | |
| public static final long M = (long) 1e9 + 7; | |
| public static long[] F, invF; | |
| private static boolean generated = false; | |
| private static int maxN = 0; | |
| public static long add(long a, long b) { | |
| long res = (a + b) % M; | |
| return res < 0 ? res + M : res; | |
| } | |
| public static long sub(long a, long b) { | |
| long res = (a - b) % M; | |
| return res < 0 ? res + M : res; | |
| } | |
| public static long mul(long a, long b) { | |
| return ((a % M) * (b % M)) % M; | |
| } | |
| public static long div(long a, long b) { | |
| return mul(a, inv(b)); | |
| } | |
| public static long inv(long a) { | |
| return pow(a, M - 2); | |
| } | |
| public static long pow(long a, long b) { | |
| long res = 1; | |
| a %= M; | |
| while (b > 0) { | |
| if ((b & 1) == 1) { | |
| res = mul(res, a); | |
| } | |
| a = mul(a, a); | |
| b >>= 1; | |
| } | |
| return res; | |
| } | |
| public static void genFact(int n) { | |
| if (generated && n <= maxN) | |
| return; | |
| int N = n + 1; | |
| F = new long[N]; | |
| invF = new long[N]; | |
| F[0] = 1L; | |
| for (int i = 1; i < N; i++) { | |
| F[i] = mul(F[i - 1], i); | |
| } | |
| invF[N - 1] = inv(F[N - 1]); | |
| for (int i = N - 2; i >= 0; i--) { | |
| invF[i] = mul(invF[i + 1], i + 1); | |
| } | |
| generated = true; | |
| maxN = N - 1; | |
| } | |
| public static long fact(int n) { | |
| if (!generated || n > maxN) { | |
| throw new IllegalArgumentException("Call genFact(" + n + ") first"); | |
| } | |
| return F[n]; | |
| } | |
| public static long invFact(int n) { | |
| if (!generated || n > maxN) { | |
| throw new IllegalArgumentException("Call genFact(" + n + ") first"); | |
| } | |
| return invF[n]; | |
| } | |
| public static long C(int n, int r) { | |
| if (!generated || n > maxN) { | |
| throw new IllegalArgumentException("Call genFact(" + n + ") first"); | |
| } | |
| if (r < 0 || r > n) | |
| return 0; | |
| return mul(F[n], mul(invF[r], invF[n - r])); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "workbench.colorTheme": "Gruvbox Dark Medium", | |
| "workbench.sideBar.location": "right", | |
| "[java]": { | |
| "editor.defaultFormatter": "redhat.java" | |
| }, | |
| "editor.autoClosingBrackets": "never", | |
| "editor.autoClosingQuotes": "never", | |
| "java.format.settings.url": ".vscode/java-formatter.xml", | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "2.0.0", | |
| "tasks": [ | |
| { | |
| "type": "shell", | |
| "label": "compile & run java - with debug", | |
| "command": "source \"$HOME/.sdkman/bin/sdkman-init.sh\" && javac ${file} && URMOM=1 timeout 1s java -ea -classpath ${cwd} ${fileBasenameNoExtension} < ${cwd}/in | head -n 1000 > ${cwd}/out.ansi", | |
| "presentation": { | |
| "echo": true, | |
| "reveal": "silent", | |
| "focus": false, | |
| "panel": "shared", | |
| "showReuseMessage": false, | |
| "clear": false | |
| }, | |
| "group": { | |
| "kind": "build", | |
| "isDefault": true | |
| } | |
| }, | |
| { | |
| "type": "shell", | |
| "label": "remove debug statements", | |
| "command": "python3 ${cwd}/comment.py comment ${file}", | |
| "presentation": { | |
| "echo": true, | |
| "reveal": "silent", | |
| "focus": false, | |
| "panel": "shared", | |
| "showReuseMessage": false, | |
| "clear": false | |
| }, | |
| "group": { | |
| "kind": "build", | |
| "isDefault": false | |
| }, | |
| "problemMatcher": [] | |
| }, | |
| { | |
| "type": "shell", | |
| "label": "undo remove debug statements", | |
| "command": "python3 ${cwd}/comment.py uncomment ${file}", | |
| "presentation": { | |
| "echo": true, | |
| "reveal": "silent", | |
| "focus": false, | |
| "panel": "shared", | |
| "showReuseMessage": false, | |
| "clear": false | |
| }, | |
| "group": { | |
| "kind": "build", | |
| "isDefault": false | |
| } | |
| } | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| import java.io.*; | |
| public class Main { | |
| static InputStream inputStream; | |
| static OutputStream outputStream; | |
| static InputReader in; | |
| static PrintWriter out; | |
| static Random random; | |
| static String PROB_NAME = ""; | |
| static final int ENABLE_ERR = 1; | |
| /////////////////////////////////////// | |
| // solution | |
| /////////////////////////////////////// | |
| static final int MULTIPLE_TESTCASES = 1; | |
| private static void precompute() {} | |
| static class Solution { | |
| public void solve(int tc) throws IOException {} | |
| } | |
| /////////////////////////////////////// | |
| // template | |
| /////////////////////////////////////// | |
| public static void main(String[] args) throws IOException { | |
| inputStream = System.in; | |
| outputStream = System.out; | |
| random = new Random(); | |
| if (PROB_NAME != "") { | |
| inputStream = new FileInputStream(new File(PROB_NAME + ".in")); | |
| outputStream = new FileOutputStream(new File(PROB_NAME + ".out")); | |
| } | |
| in = new InputReader(inputStream); | |
| out = new PrintWriter(outputStream); | |
| int tc = 1; | |
| if (MULTIPLE_TESTCASES > 0) | |
| tc = in.ni(); | |
| precompute(); | |
| Solution sol = new Solution(); | |
| for (int i = 1; i <= tc; ++i) { | |
| sol.solve(i); | |
| } | |
| in.close(); | |
| out.close(); | |
| } | |
| static class InputReader { | |
| BufferedReader reader; | |
| StringTokenizer st; | |
| public InputReader(InputStream in) { | |
| reader = new BufferedReader(new InputStreamReader(in)); | |
| st = null; | |
| } | |
| public String ns() throws IOException { | |
| while (st == null || !st.hasMoreTokens()) { | |
| st = new StringTokenizer(reader.readLine()); | |
| } | |
| return st.nextToken(); | |
| } | |
| public Long nl() throws IOException { | |
| return Long.parseLong(ns()); | |
| } | |
| public Integer ni() throws IOException { | |
| return Integer.parseInt(ns()); | |
| } | |
| public int[] nia(int n) throws IOException { | |
| int[] a = new int[n]; | |
| for (int i = 0; i < n; ++i) { | |
| a[i] = ni(); | |
| } | |
| return a; | |
| } | |
| public long[] nla(int n) throws IOException { | |
| long[] a = new long[n]; | |
| for (int i = 0; i < n; ++i) { | |
| a[i] = nl(); | |
| } | |
| return a; | |
| } | |
| public void close() throws IOException { | |
| reader.close(); | |
| } | |
| } | |
| static class err { | |
| static boolean ok = false; | |
| static { | |
| try { | |
| ok = System.getenv("URMOM") != null; | |
| } catch (Exception e) { | |
| ok = false; | |
| } | |
| } | |
| public static void ef(String format, Object... args) { | |
| if (ok && ENABLE_ERR == 1) { | |
| out.print("\u001B[31m"); | |
| out.printf(format, args); | |
| out.print("\u001B[0m"); | |
| } | |
| } | |
| public static void e(String s) { | |
| if (ok && ENABLE_ERR == 1) { | |
| out.print("\u001B[31m"); | |
| out.println(s); | |
| out.print("\u001B[0m"); | |
| } | |
| } | |
| } | |
| } |
Comments are disabled for this gist.