├── .gitignore ├── A ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── B ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── C ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── D ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── E ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── F ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── G ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── H ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── I ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── J ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── K ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── L ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── M ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── N ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── O ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── P ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── Q ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── R ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── S ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py ├── T ├── cpp │ └── code.cpp ├── java │ └── Solution.java ├── js │ └── code.js └── python │ └── code.py └── U ├── cpp └── code.cpp ├── java └── Solution.java ├── js └── code.js └── python └── code.py /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode -------------------------------------------------------------------------------- /A/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | int GetSum(int a, int b) { 6 | // Здесь реализация вашего решения 7 | } 8 | 9 | int main() { 10 | int a, b; 11 | cin >> a >> b; 12 | cout << GetSum(a, b); 13 | } -------------------------------------------------------------------------------- /A/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Solution { 4 | 5 | private static int getSum(int a, int b) { 6 | // Ваше решение 7 | } 8 | 9 | public static void main(String[] args) { 10 | Scanner scanner = new Scanner(System.in); 11 | int a = scanner.nextInt(); 12 | int b = scanner.nextInt(); 13 | System.out.println(getSum(a, b)); 14 | scanner.close(); 15 | } 16 | } -------------------------------------------------------------------------------- /A/js/code.js: -------------------------------------------------------------------------------- 1 | const _readline = require('readline'); 2 | 3 | const _reader = _readline.createInterface({ 4 | input: process.stdin 5 | }); 6 | 7 | const _inputLines = []; 8 | let _curLine = 0; 9 | 10 | // Установим callback на считывание строки - так мы получим 11 | // все строки из ввода в массиве _inputLines. 12 | _reader.on('line', line => { 13 | _inputLines.push(line); 14 | }); 15 | 16 | process.stdin.on('end', solve); 17 | 18 | 19 | // Функция парсит число из очередной строки массива _inputLines 20 | // и сдвигает указатель на единицу вперёд. 21 | function readNumber() { 22 | return Number(_inputLines[_curLine++]); 23 | } 24 | 25 | function getSum(a, b) { 26 | // Ваше решение 27 | } 28 | 29 | function solve() { 30 | const a = readNumber(); 31 | const b = readNumber(); 32 | 33 | console.log(getSum(a, b)); 34 | } -------------------------------------------------------------------------------- /A/python/code.py: -------------------------------------------------------------------------------- 1 | from typing import Tuple 2 | 3 | def get_sum(a: int, b: int) -> int: 4 | # Здесь реализация вашего решения 5 | pass 6 | 7 | def read_input() -> Tuple[int, int]: 8 | a = int(input()) 9 | b = int(input()) 10 | return a, b 11 | 12 | a, b = read_input() 13 | print(get_sum(a, b)) -------------------------------------------------------------------------------- /B/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | 7 | long getCardCount(int n, int k, const vector &cards) { 8 | // your code goes here 9 | return 0; 10 | } 11 | 12 | int readInt() { 13 | int x; 14 | cin >> x; 15 | return x; 16 | } 17 | 18 | vector readList(int n) { 19 | vector res(n); 20 | for (int i = 0; i < n; i++) { 21 | cin >> res[i]; 22 | } 23 | return res; 24 | } 25 | 26 | int main() { 27 | int n = readInt(); 28 | int k = readInt(); 29 | vector cards = readList(n); 30 | cout << getCardCount(n, k, cards); 31 | } -------------------------------------------------------------------------------- /B/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.IOException; 3 | import java.io.InputStreamReader; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | import java.util.stream.Collectors; 7 | 8 | public class Solution { 9 | 10 | private static long getCardCount(int n, int k, List cards) { 11 | // your code goes here 12 | return 0; 13 | } 14 | 15 | public static void main(String[] args) throws IOException { 16 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 17 | int n = readInt(reader); 18 | int k = readInt(reader); 19 | List cards = readList(reader); 20 | 21 | System.out.println(getCardCount(n, k, cards)); 22 | } 23 | } 24 | 25 | private static List readList(BufferedReader reader) throws IOException { 26 | return Arrays.asList(reader.readLine().strip().split(" ")) 27 | .stream() 28 | .map(token -> Long.parseLong(token)) 29 | .collect(Collectors.toList()); 30 | } 31 | 32 | private static int readInt(BufferedReader reader) throws NumberFormatException, IOException { 33 | return Integer.parseInt(reader.readLine()); 34 | } 35 | } -------------------------------------------------------------------------------- /B/js/code.js: -------------------------------------------------------------------------------- 1 | function getCardCount(n, k, cards) { 2 | // your code goes here 3 | return 0; 4 | } 5 | 6 | 7 | const _readline = require('readline'); 8 | 9 | const _reader = _readline.createInterface({ 10 | input: process.stdin 11 | }); 12 | 13 | const _inputLines = []; 14 | let _curLine = 0; 15 | 16 | _reader.on('line', line => { 17 | _inputLines.push(line); 18 | }); 19 | 20 | process.stdin.on('end', solve); 21 | 22 | 23 | function solve() { 24 | const n = readInt(); 25 | const k = readInt(); 26 | const cards = readArray(); 27 | const ans = getCardCount(n, k, cards); 28 | console.log(ans); 29 | } 30 | 31 | function readInt() { 32 | const n = Number(_inputLines[_curLine]); 33 | _curLine++; 34 | return n; 35 | } 36 | 37 | function readArray() { 38 | var arr = _inputLines[_curLine].trim(" ").split(" ").map(num => Number(num)); 39 | _curLine++; 40 | return arr; 41 | } -------------------------------------------------------------------------------- /B/python/code.py: -------------------------------------------------------------------------------- 1 | def get_card_count(n, k, cards) -> int: 2 | # your code goes here 3 | return 0 4 | 5 | 6 | n = int(input()) 7 | k = int(input()) 8 | cards = list(map(int, input().split())) 9 | 10 | print(get_card_count(n, k, cards)) -------------------------------------------------------------------------------- /C/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | 7 | long long getNumberOfGoodPairs(int n, const vector& numbers) { 8 | // your code goes here 9 | return 0; 10 | } 11 | 12 | int readInt() { 13 | int x; 14 | cin >> x; 15 | return x; 16 | } 17 | 18 | vector readList(int n) { 19 | vector res(n); 20 | for (int i = 0; i < n; i++) { 21 | cin >> res[i]; 22 | } 23 | return res; 24 | } 25 | 26 | int main() { 27 | int n = readInt(); 28 | vector numbers = readList(n); 29 | cout << getNumberOfGoodPairs(n, numbers); 30 | } -------------------------------------------------------------------------------- /C/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.IOException; 3 | import java.io.InputStreamReader; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | import java.util.stream.Collectors; 7 | 8 | 9 | public class Solution { 10 | 11 | private static long getNumberOfGoodPairs(int n, List numbers) { 12 | // your code goes here 13 | return 0; 14 | } 15 | 16 | public static void main(String[] args) throws IOException { 17 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 18 | int n = readInt(reader); 19 | List numbers = readList(reader); 20 | System.out.println(getNumberOfGoodPairs(n, numbers)); 21 | } 22 | } 23 | 24 | private static List readList(BufferedReader reader) throws IOException { 25 | return Arrays.asList(reader.readLine().strip().split(" ")) 26 | .stream() 27 | .map(token -> Integer.parseInt(token)) 28 | .collect(Collectors.toList()); 29 | } 30 | 31 | private static int readInt(BufferedReader reader) throws NumberFormatException, IOException { 32 | return Integer.parseInt(reader.readLine()); 33 | } 34 | } -------------------------------------------------------------------------------- /C/js/code.js: -------------------------------------------------------------------------------- 1 | function getNumberOfGoodPairs(n, numbers) { 2 | // your code goes here 3 | return 0; 4 | } 5 | 6 | 7 | const _readline = require('readline'); 8 | 9 | const _reader = _readline.createInterface({ 10 | input: process.stdin 11 | }); 12 | 13 | const _inputLines = []; 14 | let _curLine = 0; 15 | 16 | _reader.on('line', line => { 17 | _inputLines.push(line); 18 | }); 19 | 20 | process.stdin.on('end', solve); 21 | 22 | 23 | function solve() { 24 | const n = readInt(); 25 | const numbers = readArray(); 26 | const ans = getNumberOfGoodPairs(n, numbers); 27 | console.log(ans); 28 | } 29 | 30 | function readInt() { 31 | const n = Number(_inputLines[_curLine]); 32 | _curLine++; 33 | return n; 34 | } 35 | 36 | function readArray() { 37 | var arr = _inputLines[_curLine].trim(" ").split(" ").map(num => Number(num)); 38 | _curLine++; 39 | return arr; 40 | } 41 | -------------------------------------------------------------------------------- /C/python/code.py: -------------------------------------------------------------------------------- 1 | def get_number_of_good_pairs(numbers) -> int: 2 | # your code goes here 3 | return 0 4 | 5 | 6 | n = int(input()) 7 | numbers = list(map(int, input().split())) 8 | print(get_number_of_good_pairs(numbers)) -------------------------------------------------------------------------------- /D/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | 7 | int getLongestIncreasingPath(int n, int m, const vector>& matrixs) { 8 | // your code goes here 9 | return 0; 10 | } 11 | 12 | int readInt() { 13 | int x; 14 | cin >> x; 15 | return x; 16 | } 17 | 18 | vector readList(int n) { 19 | vector res(n); 20 | for (int i = 0; i < n; i++) { 21 | cin >> res[i]; 22 | } 23 | return res; 24 | } 25 | 26 | vector> readMatrix(int n, int m) { 27 | vector> matrix(n, vector(m)); 28 | for (int i = 0; i < n; i++) { 29 | matrix[i] = readList(m); 30 | } 31 | return matrix; 32 | } 33 | 34 | int main() { 35 | int n, m; 36 | cin >> n >> m; 37 | vector> matrix = readMatrix(n, m); 38 | cout << getLongestIncreasingPath(n, m, matrix); 39 | } -------------------------------------------------------------------------------- /D/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.IOException; 3 | import java.io.InputStreamReader; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.List; 7 | import java.util.stream.Collectors; 8 | 9 | public class Solution{ 10 | 11 | private static int getLongestIncreasingPath(List> matrix) { 12 | // your code goes here 13 | return 0; 14 | } 15 | 16 | public static void main(String[] args) throws IOException { 17 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 18 | List> matrix = readMatrix(reader); 19 | 20 | System.out.println(getLongestIncreasingPath(matrix)); 21 | } 22 | 23 | } 24 | 25 | private static List> readMatrix(BufferedReader reader) throws IOException { 26 | String[] sizes = reader.readLine().strip().split(" "); 27 | int n = Integer.parseInt(sizes[0]); 28 | List> matrix = new ArrayList>(n); 29 | for (int i = 0; i < n; i++) { 30 | matrix.add(readList(reader)); 31 | } 32 | return matrix; 33 | } 34 | 35 | private static List readList(BufferedReader reader) throws IOException { 36 | return Arrays.asList(reader.readLine().strip().split(" ")) 37 | .stream() 38 | .map(token -> Integer.parseInt(token)) 39 | .collect(Collectors.toList()); 40 | } 41 | } -------------------------------------------------------------------------------- /D/js/code.js: -------------------------------------------------------------------------------- 1 | function getLongestIncreasingPath(matrix) { 2 | // your code goes here 3 | return 0; 4 | } 5 | 6 | 7 | const _readline = require('readline'); 8 | 9 | const _reader = _readline.createInterface({ 10 | input: process.stdin 11 | }); 12 | 13 | const _inputLines = []; 14 | let _curLine = 0; 15 | 16 | _reader.on('line', line => { 17 | _inputLines.push(line); 18 | }); 19 | 20 | process.stdin.on('end', solve); 21 | 22 | 23 | function solve() { 24 | const matrix = readMatrix(); 25 | const ans = getLongestIncreasingPath(matrix); 26 | console.log(ans); 27 | } 28 | 29 | function readInt() { 30 | const n = Number(_inputLines[_curLine]); 31 | _curLine++; 32 | return n; 33 | } 34 | 35 | function readArray() { 36 | var arr = _inputLines[_curLine].trim(" ").split(" ").map(num => Number(num)); 37 | _curLine++; 38 | return arr; 39 | } 40 | 41 | function readMatrix() { 42 | let sizes = readArray(); 43 | let n = sizes[0]; 44 | let matrix = []; 45 | for (let i = 0; i < n; i++) { 46 | matrix.push(readArray()); 47 | } 48 | return matrix; 49 | } -------------------------------------------------------------------------------- /D/python/code.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | 4 | def get_longest_increasing_path(matrix: List[List[int]]) -> int: 5 | # your code goes here 6 | return 0 7 | 8 | def read_matrix() -> List[List[int]]: 9 | n, m = map(int, input().split()) 10 | matrix = [] 11 | for i in range(n): 12 | matrix.append(list(map(int, input().split()))) 13 | return matrix 14 | 15 | matrix = read_matrix() 16 | print(get_longest_increasing_path(matrix)) -------------------------------------------------------------------------------- /E/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | 6 | int convertToArabic(const string& romanNumber) { 7 | // your code goes here 8 | return 0; 9 | } 10 | 11 | int main() { 12 | string romanNumber; 13 | cin >> romanNumber; 14 | cout << convertToArabic(romanNumber); 15 | } -------------------------------------------------------------------------------- /E/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.IOException; 3 | import java.io.InputStreamReader; 4 | 5 | 6 | public class Solution { 7 | 8 | private static int convertToArabic(String romanNumber) { 9 | // your code goes here 10 | return -1; 11 | } 12 | 13 | public static void main(String[] args) throws IOException { 14 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 15 | String romanNumber = reader.readLine().strip(); 16 | System.out.println(convertToArabic(romanNumber)); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /E/js/code.js: -------------------------------------------------------------------------------- 1 | function convertToArabic(romanNumber) { 2 | // your code goes here 3 | return -1; 4 | } 5 | 6 | 7 | const _readline = require('readline'); 8 | 9 | const _reader = _readline.createInterface({ 10 | input: process.stdin 11 | }); 12 | 13 | const _inputLines = []; 14 | let _curLine = 0; 15 | 16 | _reader.on('line', line => { 17 | _inputLines.push(line); 18 | }); 19 | 20 | process.stdin.on('end', solve); 21 | 22 | 23 | function solve() { 24 | const romanNumber = readLine(); 25 | const ans = convertToArabic(romanNumber); 26 | console.log(ans); 27 | } 28 | 29 | function readLine() { 30 | const line = _inputLines[_curLine]; 31 | _curLine++; 32 | return line; 33 | } 34 | -------------------------------------------------------------------------------- /E/python/code.py: -------------------------------------------------------------------------------- 1 | def convert_to_arabic(number: str) -> int: 2 | # your code goes here 3 | return -1 4 | 5 | roman_number = input() 6 | print(convert_to_arabic(roman_number)) -------------------------------------------------------------------------------- /F/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | 6 | string convertToGoodString(const string& probablyBadString) { 7 | // your code goes here 8 | return ""; 9 | } 10 | 11 | int main() { 12 | string probablyBadString; 13 | cin >> probablyBadString; 14 | cout << convertToGoodString(probablyBadString); 15 | } -------------------------------------------------------------------------------- /F/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.IOException; 3 | import java.io.InputStreamReader; 4 | 5 | 6 | public class Solution { 7 | 8 | private static String convertToGoodString(String probablyBadString) { 9 | // your code goes here 10 | return ""; 11 | } 12 | 13 | public static void main(String[] args) throws IOException { 14 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 15 | String probablyBadString = reader.readLine().strip(); 16 | System.out.println(convertToGoodString(probablyBadString)); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /F/js/code.js: -------------------------------------------------------------------------------- 1 | function convertToGoodString(probablyBadString) { 2 | // your code goes here 3 | return ""; 4 | } 5 | 6 | const _readline = require('readline'); 7 | 8 | const _reader = _readline.createInterface({ 9 | input: process.stdin 10 | }); 11 | 12 | const _inputLines = []; 13 | let _curLine = 0; 14 | 15 | _reader.on('line', line => { 16 | _inputLines.push(line); 17 | }); 18 | 19 | process.stdin.on('end', solve); 20 | 21 | 22 | function solve() { 23 | const probablyBadString = readLine(); 24 | const ans = convertToGoodString(probablyBadString); 25 | console.log(ans); 26 | } 27 | 28 | function readLine() { 29 | const line = _inputLines[_curLine]; 30 | _curLine++; 31 | return line; 32 | } 33 | -------------------------------------------------------------------------------- /F/python/code.py: -------------------------------------------------------------------------------- 1 | def convert_to_good_string(probably_bad_string: str) -> str: 2 | # your code goes here 3 | return "" 4 | 5 | probably_bad_string = input() 6 | print(convert_to_good_string(probably_bad_string)) -------------------------------------------------------------------------------- /G/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | struct Vertex { 7 | int w; 8 | int p; 9 | 10 | Vertex(int w, int p) { 11 | w = w; 12 | p = p; 13 | } 14 | }; 15 | 16 | 17 | int getNumberOfUpgoingPaths(vector tree, int x) { 18 | // your code goes here 19 | return 0; 20 | } 21 | 22 | vector readTree(int n) { 23 | vector tree; 24 | for (int i = 0; i < n; i++) { 25 | int parent, weight; 26 | cin >> parent >> weight; 27 | tree.push_back(Vertex(weight, parent)); 28 | } 29 | return tree; 30 | } 31 | 32 | int main() { 33 | int n; 34 | cin >> n; 35 | int x; 36 | cin >> x; 37 | vector tree = readTree(n); 38 | cout << getNumberOfUpgoingPaths(tree, x); 39 | 40 | } -------------------------------------------------------------------------------- /G/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.IOException; 3 | import java.io.InputStreamReader; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.List; 7 | import java.util.stream.Collectors; 8 | 9 | 10 | public class Solution { 11 | 12 | private static int getNumberOfUpgoingPaths(List tree, int x) { 13 | // your code goes here 14 | return 0; 15 | } 16 | 17 | public static void main(String[] args) throws IOException { 18 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 19 | List firstLine = readTwoNumbers(reader); 20 | int n = firstLine.get(0); 21 | int x = firstLine.get(1); 22 | List tree = readTree(reader, n); 23 | System.out.println(getNumberOfUpgoingPaths(tree, x)); 24 | } 25 | } 26 | 27 | private static List readTree(BufferedReader reader, int n) throws IOException { 28 | List tree = new ArrayList<>(n); 29 | for (int i = 0; i < n; i++) { 30 | List parentAndWeight = readTwoNumbers(reader); 31 | tree.add(new Vertex(parentAndWeight.get(1), parentAndWeight.get(0))); 32 | } 33 | return tree; 34 | } 35 | 36 | private static List readTwoNumbers(BufferedReader reader) throws IOException { 37 | return Arrays.asList(reader.readLine().strip().split(" ")) 38 | .stream() 39 | .map(elem -> Integer.parseInt(elem)) 40 | .collect(Collectors.toList()); 41 | } 42 | 43 | private static class Vertex { 44 | public final int w; 45 | public final int p; 46 | 47 | public Vertex(int w, int p) { 48 | this.w = w; 49 | this.p = p; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /G/js/code.js: -------------------------------------------------------------------------------- 1 | class Vertex { 2 | constructor(weight, parent) { 3 | this.weight = weight; 4 | this.parent = parent; 5 | } 6 | } 7 | 8 | function getNumberOfUpgoingPaths(tree, x) { 9 | // your code goes here 10 | return 0; 11 | } 12 | 13 | const _readline = require('readline'); 14 | 15 | const _reader = _readline.createInterface({ 16 | input: process.stdin 17 | }); 18 | 19 | const _inputLines = []; 20 | let _curLine = 0; 21 | 22 | _reader.on('line', line => { 23 | _inputLines.push(line); 24 | }); 25 | 26 | process.stdin.on('end', solve); 27 | 28 | 29 | function solve() { 30 | const firsLine = readArray(); 31 | const n = firsLine[0]; 32 | const x = firsLine[1]; 33 | const tree = readTree(n); 34 | const ans = getNumberOfUpgoingPaths(tree, x); 35 | console.log(ans); 36 | } 37 | 38 | function readInt() { 39 | const n = Number(_inputLines[_curLine]); 40 | _curLine++; 41 | return n; 42 | } 43 | 44 | function readArray() { 45 | var arr = _inputLines[_curLine].trim(" ").split(" ").map(num => Number(num)); 46 | _curLine++; 47 | return arr; 48 | } 49 | 50 | function readTree(n) { 51 | let tree = []; 52 | for (let i = 0; i < n; i++) { 53 | let vertex = readArray(); 54 | tree.push(new Vertex(vertex[1], vertex[0])); 55 | } 56 | return tree; 57 | } -------------------------------------------------------------------------------- /G/python/code.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | class Node: 4 | # feel free to change fields 5 | def __init__(self, weight, parent) -> None: 6 | self.weight = weight 7 | self.parent = parent 8 | self.children = [] 9 | 10 | 11 | def get_number_of_upgoing_paths(root: Node, x: int) -> int: 12 | # your code goes here 13 | return 0 14 | 15 | def read_tree(tree_size: int) -> Node: 16 | nodes = [] 17 | root = None 18 | for i in range(tree_size): 19 | p, w = map(int, input().split()) 20 | nodes.append(Node(w, p)) 21 | if p == -1: 22 | root = nodes[i] 23 | for i in range(tree_size): 24 | if nodes[i].parent != -1: 25 | nodes[nodes[i].parent].children.append(nodes[i]) 26 | return root 27 | 28 | 29 | n, x = map(int, input().split()) 30 | tree = read_tree(n) 31 | print(get_number_of_upgoing_paths(tree, x)) 32 | -------------------------------------------------------------------------------- /H/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | long long getEnergyForUnion(const vector& stones) { 7 | // your code goes here 8 | return 0; 9 | } 10 | 11 | vector readList(int n) { 12 | vector res(n); 13 | for (int i = 0; i < n; i++) { 14 | cin >> res[i]; 15 | } 16 | return res; 17 | } 18 | 19 | int main() { 20 | int n; 21 | cin >> n; 22 | vector stones = readList(n); 23 | 24 | cout << getEnergyForUnion(stones); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /H/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.IOException; 3 | import java.io.InputStreamReader; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | import java.util.stream.Collectors; 7 | 8 | 9 | public class Solution { 10 | 11 | private static long getEnergyForUnion(List stones) { 12 | // your code goes here 13 | return 0; 14 | } 15 | 16 | public static void main(String[] args) throws IOException { 17 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 18 | int n = readInt(reader); 19 | List stones = readList(reader); 20 | 21 | System.out.println(getEnergyForUnion(stones)); 22 | } 23 | } 24 | 25 | private static List readList(BufferedReader reader) throws IOException { 26 | return Arrays.asList(reader.readLine().strip().split(" ")) 27 | .stream() 28 | .map(token -> Integer.parseInt(token)) 29 | .collect(Collectors.toList()); 30 | } 31 | 32 | private static int readInt(BufferedReader reader) throws NumberFormatException, IOException { 33 | return Integer.parseInt(reader.readLine()); 34 | } 35 | } -------------------------------------------------------------------------------- /H/js/code.js: -------------------------------------------------------------------------------- 1 | function getEnergyForUnion(stones) { 2 | // your code goes here 3 | return 0; 4 | } 5 | 6 | const _readline = require('readline'); 7 | 8 | const _reader = _readline.createInterface({ 9 | input: process.stdin 10 | }); 11 | 12 | const _inputLines = []; 13 | let _curLine = 0; 14 | 15 | _reader.on('line', line => { 16 | _inputLines.push(line); 17 | }); 18 | 19 | process.stdin.on('end', solve); 20 | 21 | 22 | function solve() { 23 | const n = readInt(); 24 | const stones = readArray(); 25 | const ans = getEnergyForUnion(stones); 26 | console.log(ans); 27 | } 28 | 29 | function readInt() { 30 | const n = Number(_inputLines[_curLine]); 31 | _curLine++; 32 | return n; 33 | } 34 | 35 | function readArray() { 36 | var arr = _inputLines[_curLine].trim(" ").split(" ").map(num => Number(num)); 37 | _curLine++; 38 | return arr; 39 | } -------------------------------------------------------------------------------- /H/python/code.py: -------------------------------------------------------------------------------- 1 | def get_energy_for_union(stones): 2 | # your code goes here 3 | return 0 4 | 5 | n = int(input()) 6 | stones = list(map(int, input().split())) 7 | 8 | print(get_energy_for_union(stones)) -------------------------------------------------------------------------------- /I/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include "solution.h" 2 | 3 | using namespace std; 4 | 5 | /** Comment it before submitting 6 | struct Node { 7 | int val; 8 | Node* next; 9 | Node(int val_, Node* next_) { 10 | val = val_; 11 | next = next_; 12 | } 13 | }; 14 | **/ 15 | 16 | 17 | Node* Reverse(Node* head, int left, int right) { 18 | // Your code 19 | // “ヽ(´▽`)ノ” 20 | } -------------------------------------------------------------------------------- /I/java/Solution.java: -------------------------------------------------------------------------------- 1 | /** Comment it before submitting 2 | public class Node { 3 | 4 | public final int val; 5 | public Node next; 6 | 7 | public Node(int val) { 8 | this.val = val; 9 | } 10 | 11 | public Node(int val, Node next) { 12 | this.val = val; 13 | this.next = next; 14 | } 15 | } 16 | */ 17 | 18 | 19 | class Solution { 20 | public static Node Reverse(Node head, int left, int right) { 21 | // Your code 22 | // “ヽ(´▽`)ノ” 23 | } 24 | } -------------------------------------------------------------------------------- /I/js/code.js: -------------------------------------------------------------------------------- 1 | /** Comment it before submitting 2 | class Node { 3 | constructor(value = null, next = null) { 4 | this.value = value; 5 | this.next = next; 6 | } 7 | } 8 | */ 9 | 10 | /** 11 | * @param {Node} head 12 | * @param {number} left 13 | * @param {number} right 14 | * @return {Node} 15 | */ 16 | var Reverse = function(head, left, right) { 17 | // Your code 18 | // “ヽ(´▽`)ノ” 19 | }; -------------------------------------------------------------------------------- /I/python/code.py: -------------------------------------------------------------------------------- 1 | from node import Node 2 | 3 | # Comment it before submitting 4 | # class Node: 5 | # def __init__(self, value, next=None): 6 | # self.value = value 7 | # self.next = next 8 | 9 | def Reverse(head: Node, left: int, right: int) -> Node: 10 | # Your code 11 | # “ヽ(´▽`)ノ” 12 | pass 13 | -------------------------------------------------------------------------------- /J/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | vector> getAllPeacefulCombinations(int n) { 7 | // your code goes here 8 | return {}; 9 | } 10 | 11 | void printArray(const vector& combination) { 12 | for (int elem : combination) { 13 | cout << elem << " "; 14 | } 15 | cout << endl; 16 | } 17 | 18 | void outputAnswer(const vector>& possibleCombinations) { 19 | cout << possibleCombinations.size() << endl; 20 | for (const vector& combination : possibleCombinations) { 21 | printArray(combination); 22 | } 23 | } 24 | 25 | int main() { 26 | int n; 27 | cin >> n; 28 | vector> possibleCombinations = getAllPeacefulCombinations(n); 29 | outputAnswer(possibleCombinations); 30 | } 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /J/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.BufferedWriter; 3 | import java.io.IOException; 4 | import java.io.InputStreamReader; 5 | import java.io.OutputStreamWriter; 6 | import java.util.List; 7 | 8 | 9 | public class Solution { 10 | 11 | private static List> getAllPeacefulCombinations(int n) { 12 | // your code goes here 13 | return List.of(); 14 | } 15 | 16 | 17 | public static void main(String[] args) throws IOException { 18 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); 19 | BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out))) { 20 | int n = readInt(reader); 21 | List> possibleCombinations = getAllPeacefulCombinations(n); 22 | 23 | outputAnswer(writer, possibleCombinations); 24 | } 25 | } 26 | 27 | 28 | private static void outputAnswer(BufferedWriter writer, List> possibleCombinations) throws IOException { 29 | writer.write(possibleCombinations.size() + "\n"); 30 | for (List combination : possibleCombinations) { 31 | printArray(writer, combination); 32 | } 33 | } 34 | 35 | 36 | private static void printArray(BufferedWriter writer, List combination) throws IOException { 37 | for (int elem : combination) { 38 | writer.write(elem + " "); 39 | } 40 | writer.write("\n"); 41 | } 42 | 43 | 44 | private static int readInt(BufferedReader reader) throws IOException { 45 | return Integer.parseInt(reader.readLine()); 46 | } 47 | } -------------------------------------------------------------------------------- /J/js/code.js: -------------------------------------------------------------------------------- 1 | function getAllPeacefulCombinations(n) { 2 | // your code goes here 3 | // answer for sample 1 4 | return [[2, 4, 1, 3], [3, 1, 4, 2]]; 5 | } 6 | 7 | const _readline = require('readline'); 8 | 9 | const _reader = _readline.createInterface({ 10 | input: process.stdin 11 | }); 12 | 13 | const _inputLines = []; 14 | let _curLine = 0; 15 | 16 | _reader.on('line', line => { 17 | _inputLines.push(line); 18 | }); 19 | 20 | process.stdin.on('end', solve); 21 | 22 | 23 | function solve() { 24 | const n = readInt(); 25 | const combinations = getAllPeacefulCombinations(n); 26 | outputAnswer(combinations); 27 | } 28 | 29 | function outputAnswer(combinations) { 30 | process.stdout.write(`${combinations.length}\n`); 31 | for (let combination of combinations) { 32 | process.stdout.write(`${combination.join(' ')}\n`); 33 | } 34 | } 35 | 36 | function readInt() { 37 | const n = Number(_inputLines[_curLine]); 38 | _curLine++; 39 | return n; 40 | } -------------------------------------------------------------------------------- /J/python/code.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | 4 | def get_all_peaceful_combinations(n) -> List[List[int]]: 5 | # your code goes here 6 | return [[]] 7 | 8 | n = int(input()) 9 | combinations = get_all_peaceful_combinations(n) 10 | 11 | print(len(combinations)) 12 | for combination in combinations: 13 | print(*combination) -------------------------------------------------------------------------------- /K/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | bool stringMatchesTemplate(const string& stringToCheck, const string& templateString) { 7 | // your code goes here 8 | return false; 9 | } 10 | 11 | int main() { 12 | string templateString; 13 | cin >> templateString; 14 | string stringToCheck; 15 | cin >> stringToCheck; 16 | 17 | if (stringMatchesTemplate(stringToCheck, templateString)) { 18 | cout << "YES" << endl; 19 | } else { 20 | cout << "NO" << endl; 21 | } 22 | } 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /K/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.IOException; 3 | import java.io.InputStreamReader; 4 | 5 | 6 | public class Solution { 7 | 8 | private static boolean stringMatchesTemplate(String stringToCheck, String template) { 9 | // your code goes here 10 | return false; 11 | } 12 | 13 | public static void main(String[] args) throws IOException { 14 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 15 | String template = reader.readLine().strip(); 16 | String stringToCheck = reader.readLine().strip(); 17 | 18 | if (stringMatchesTemplate(stringToCheck, template)) { 19 | System.out.println("YES"); 20 | } else { 21 | System.out.println("NO"); 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /K/js/code.js: -------------------------------------------------------------------------------- 1 | function stringMatchesTemplate(stringToCheck, template) { 2 | // your code goes here 3 | return false; 4 | } 5 | 6 | const _readline = require('readline'); 7 | 8 | const _reader = _readline.createInterface({ 9 | input: process.stdin 10 | }); 11 | 12 | const _inputLines = []; 13 | let _curLine = 0; 14 | 15 | _reader.on('line', line => { 16 | _inputLines.push(line); 17 | }); 18 | 19 | process.stdin.on('end', solve); 20 | 21 | 22 | function solve() { 23 | 24 | const template = readLine(); 25 | const stringToCheck = readLine(); 26 | 27 | if (stringMatchesTemplate(stringToCheck, template)) { 28 | console.log("YES"); 29 | } else { 30 | console.log("NO"); 31 | } 32 | } 33 | 34 | 35 | function readLine() { 36 | const line = _inputLines[_curLine]; 37 | _curLine++; 38 | return line; 39 | } -------------------------------------------------------------------------------- /K/python/code.py: -------------------------------------------------------------------------------- 1 | def string_matches_template(s: str, template: str) -> bool: 2 | # your code goes here 3 | return False 4 | 5 | template = input() 6 | string_to_check = input() 7 | if string_matches_template(string_to_check, template): 8 | print('YES') 9 | else: 10 | print('NO') -------------------------------------------------------------------------------- /L/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | struct Segment { 7 | int left; 8 | int right; 9 | 10 | Segment(int left, int right) : left(left), right(right) { 11 | } 12 | }; 13 | 14 | vector readSegments() { 15 | int n; 16 | cin >> n; 17 | vector segments ; 18 | for (int i = 0; i < n; i++) { 19 | int left, right; 20 | cin >> left >> right; 21 | segments.push_back(Segment(left, right)); 22 | } 23 | return segments; 24 | } 25 | 26 | vector getIntersection(const vector& firstSequence, const vector& secondSequence) { 27 | // your code goes here 28 | return {}; 29 | } 30 | 31 | 32 | void outputAnswer(const vector& intersection) { 33 | for (const Segment& segment : intersection) { 34 | cout << segment.left << " " << segment.right << endl; 35 | } 36 | } 37 | 38 | int main() { 39 | vector firstSequence = readSegments(); 40 | vector secondSequence = readSegments(); 41 | 42 | vector intersection = getIntersection(firstSequence, secondSequence); 43 | outputAnswer(intersection); 44 | } -------------------------------------------------------------------------------- /L/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.BufferedWriter; 3 | import java.io.IOException; 4 | import java.io.InputStreamReader; 5 | import java.io.OutputStreamWriter; 6 | import java.util.ArrayList; 7 | import java.util.Arrays; 8 | import java.util.List; 9 | import java.util.stream.Collectors; 10 | 11 | 12 | public class Solution { 13 | 14 | private static List getIntersection(List firstSequence, List secondSequence) { 15 | // your code goes here 16 | return List.of(); 17 | } 18 | 19 | public static void main(String[] args) throws IOException { 20 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); 21 | BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out))) { 22 | List firstSequence = readSegments(reader); 23 | List secondSequence = readSegments(reader); 24 | 25 | List intersection = getIntersection(firstSequence, secondSequence); 26 | outputAnswer(intersection, writer); 27 | } 28 | } 29 | 30 | private static void outputAnswer(List intersection, BufferedWriter writer) throws IOException { 31 | for (Segment segment : intersection) { 32 | writer.write(segment.left + " " + segment.right + "\n"); 33 | } 34 | } 35 | 36 | private static List readSegments(BufferedReader reader) throws IOException { 37 | int n = readInt(reader); 38 | List segments = new ArrayList<>(n); 39 | for (int i = 0; i < n; i++) { 40 | List borders = readTwoNumbers(reader); 41 | segments.add(new Segment(borders.get(0), borders.get(1))); 42 | } 43 | return segments; 44 | } 45 | 46 | private static class Segment { 47 | public final int left; 48 | public final int right; 49 | 50 | public Segment(int left, int right) { 51 | this.left = left; 52 | this.right = right; 53 | } 54 | } 55 | 56 | private static int readInt(BufferedReader reader) throws IOException { 57 | return Integer.parseInt(reader.readLine()); 58 | } 59 | 60 | private static List readTwoNumbers(BufferedReader reader) throws IOException { 61 | return Arrays.asList(reader.readLine().strip().split(" ")) 62 | .stream() 63 | .map(elem -> Integer.parseInt(elem)) 64 | .collect(Collectors.toList()); 65 | } 66 | } -------------------------------------------------------------------------------- /L/js/code.js: -------------------------------------------------------------------------------- 1 | class Segment { 2 | constructor(left, right) { 3 | this.left = left; 4 | this.right = right; 5 | } 6 | } 7 | 8 | 9 | function getIntersection(firstSequence, secondSequence) { 10 | // your code goes here 11 | // answer for sample 1 12 | return [new Segment(1, 2), new Segment(4, 4), new Segment(5, 5)]; 13 | } 14 | 15 | const _readline = require('readline'); 16 | 17 | const _reader = _readline.createInterface({ 18 | input: process.stdin 19 | }); 20 | 21 | const _inputLines = []; 22 | let _curLine = 0; 23 | 24 | _reader.on('line', line => { 25 | _inputLines.push(line); 26 | }); 27 | 28 | process.stdin.on('end', solve); 29 | 30 | 31 | function solve() { 32 | const firstSequence = readSegments(); 33 | const secondSequence = readSegments(); 34 | const intersection = getIntersection(firstSequence, secondSequence); 35 | outputAnswer(intersection); 36 | } 37 | 38 | function readSegments() { 39 | const n = readInt(); 40 | let result = []; 41 | for (let i = 0; i < n; i++) { 42 | let segment = readArray(); 43 | result.push(new Segment(segment.left, segment.right)); 44 | } 45 | return result; 46 | } 47 | 48 | function readInt() { 49 | const n = Number(_inputLines[_curLine]); 50 | _curLine++; 51 | return n; 52 | } 53 | 54 | function readArray() { 55 | var arr = _inputLines[_curLine].trim(" ").split(" ").map(num => Number(num)); 56 | _curLine++; 57 | return arr; 58 | } 59 | 60 | function outputAnswer(intersection) { 61 | for (let segment of intersection) { 62 | process.stdout.write(`${segment.left} ${segment.right}\n`); 63 | } 64 | } -------------------------------------------------------------------------------- /L/python/code.py: -------------------------------------------------------------------------------- 1 | from typing import List, Tuple 2 | 3 | 4 | def get_intersection(first_sequence: List[Tuple[int]], second_sequence: List[Tuple[int]]) -> List[Tuple[int]]: 5 | # your code goes here 6 | return [] 7 | 8 | def read_sequence() -> List[Tuple[int]]: 9 | n = int(input()) 10 | sequnce = [] 11 | for i in range(n): 12 | start, end = map(int, input().split()) 13 | sequnce.append((start, end)) 14 | return sequnce 15 | 16 | 17 | def print_sequence(sequence: List[Tuple[int]]) -> None: 18 | for segment in sequence: 19 | print(segment[0], segment[1]) 20 | 21 | 22 | first_sequence = read_sequence() 23 | second_sequence = read_sequence() 24 | intersection = get_intersection(first_sequence, second_sequence) 25 | print_sequence(intersection) -------------------------------------------------------------------------------- /M/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | 7 | struct HistoricalArray { 8 | int size; 9 | HistoricalArray(int n) : size(n) { 10 | 11 | } 12 | 13 | void beginNewEra(int eraId) { 14 | 15 | } 16 | 17 | void set(int index, int value) { 18 | 19 | } 20 | 21 | int get(int index, int eraId) { 22 | return -1; 23 | } 24 | }; 25 | 26 | 27 | int main(int argc, char const *argv[]) { 28 | int n; 29 | cin >> n; 30 | HistoricalArray arr(n); 31 | int q; 32 | cin >> q; 33 | for (int i = 0; i < q; i++) { 34 | string queryType; 35 | cin >> queryType; 36 | if (queryType == "set") { 37 | int index, value; 38 | cin >> index >> value; 39 | arr.set(index, value); 40 | } else if (queryType == "begin_new_era") { 41 | int eraId; 42 | cin >> eraId; 43 | arr.beginNewEra(eraId); 44 | } else if (queryType == "get") { 45 | int index, eraId; 46 | cin >> index >> eraId; 47 | cout << arr.get(index, eraId) << endl; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /M/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.BufferedWriter; 3 | import java.io.IOException; 4 | import java.io.InputStreamReader; 5 | import java.io.OutputStreamWriter; 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | 10 | public class Solution { 11 | 12 | private static class HistoricalArray { 13 | // you can change signatures and set of methods as you like 14 | 15 | public HistoricalArray(int n) { 16 | // your code goes here 17 | } 18 | 19 | public void set(int index, int value) { 20 | // your code goes here 21 | } 22 | 23 | public void beginNewEra(int eraId) { 24 | // your code goes here 25 | } 26 | 27 | public int get(int index, int eraId) { 28 | // your code goes here 29 | return 0; 30 | } 31 | } 32 | 33 | public static void main(String[] args) throws IOException { 34 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); 35 | BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out))) { 36 | int n = readInt(reader); 37 | HistoricalArray array = new HistoricalArray(n); 38 | int q = readInt(reader); 39 | for (int i = 0; i < q; i++) { 40 | List queryParts = Arrays.asList(reader.readLine().strip().split(" ")); 41 | String queryType = queryParts.get(0); 42 | if (queryType.equals("set")) { 43 | int index = Integer.parseInt(queryParts.get(1)); 44 | int value = Integer.parseInt(queryParts.get(2)); 45 | array.set(index, value); 46 | } else if (queryType.equals("begin_new_era")) { 47 | int eraId = Integer.parseInt(queryParts.get(1)); 48 | array.beginNewEra(eraId); 49 | } else if (queryType.equals("get")) { 50 | int index = Integer.parseInt(queryParts.get(1)); 51 | int eraId = Integer.parseInt(queryParts.get(2)); 52 | writer.write(array.get(index, eraId) + "\n"); 53 | } 54 | } 55 | } 56 | } 57 | 58 | private static int readInt(BufferedReader reader) throws IOException { 59 | return Integer.parseInt(reader.readLine()); 60 | } 61 | } -------------------------------------------------------------------------------- /M/js/code.js: -------------------------------------------------------------------------------- 1 | class HistoricalArray { 2 | // you can change signatures and set of methods as you like 3 | 4 | constructor(n) { 5 | // your code goes here 6 | } 7 | 8 | set(index, value) { 9 | // your code goes here 10 | } 11 | 12 | beginNewEra(eraId) { 13 | // your code goes here 14 | } 15 | 16 | get(index, eraId) { 17 | // your code goes here 18 | return 0; 19 | } 20 | } 21 | 22 | const _readline = require('readline'); 23 | 24 | const _reader = _readline.createInterface({ 25 | input: process.stdin 26 | }); 27 | 28 | const _inputLines = []; 29 | let _curLine = 0; 30 | 31 | _reader.on('line', line => { 32 | _inputLines.push(line); 33 | }); 34 | 35 | process.stdin.on('end', solve); 36 | 37 | 38 | function solve() { 39 | const n = readInt(); 40 | const array = new HistoricalArray(n); 41 | const q = readInt(); 42 | for (let i = 0; i < q; i++) { 43 | const queryParts = readQuery(); 44 | const queryType = queryParts[0]; 45 | if (queryType == "set") { 46 | let index = Number(queryParts[1]); 47 | let value = Number(queryParts[2]); 48 | array.set(index, value); 49 | } else if (queryType.equals("begin_new_era")) { 50 | let eraId = Number(queryParts[1]); 51 | array.beginNewEra(eraId); 52 | } else if (queryType.equals("get")) { 53 | let index = Number(queryParts[1]); 54 | let eraId = Number(queryParts[2]); 55 | writer.write( + "\n"); 56 | process.stdout.write(`${array.get(index, eraId)}\n`); 57 | } 58 | } 59 | } 60 | 61 | function readQuery() { 62 | var arr = _inputLines[_curLine].trim(" ").split(" "); 63 | _curLine++; 64 | return arr; 65 | } -------------------------------------------------------------------------------- /M/python/code.py: -------------------------------------------------------------------------------- 1 | class HistoricalArray: 2 | def __init__(self, size) -> None: 3 | # your code goes here 4 | pass 5 | 6 | def set(self, index, value) -> None: 7 | # your code goes here 8 | pass 9 | 10 | def get(self, index, era_id) -> int: 11 | # your code goes here 12 | pass 13 | 14 | def begin_new_era(self, era_id) -> None: 15 | # your code goes here 16 | pass 17 | 18 | size = int(input()) 19 | q = int(input()) 20 | historical_array = HistoricalArray(size) 21 | for i in range(q): 22 | query = input().split() 23 | query_type = query[0] 24 | if query_type == "set": 25 | historical_array.set(int(query[1]), int(query[2])) 26 | elif query_type == "begin_new_era": 27 | historical_array.begin_new_era(int(query[1])) 28 | else: 29 | print(historical_array.get(int(query[1]), int(query[2]))) -------------------------------------------------------------------------------- /N/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include "solution.h" 2 | 3 | /** Comment it before submitting 4 | struct Node { 5 | int val; 6 | std::vector neighbours; 7 | Node(int val_) { 8 | val = val_; 9 | neighbours = {}; 10 | } 11 | }; 12 | **/ 13 | 14 | Node* cloneGraph(Node* node) { 15 | // Your code 16 | // “ヽ(´▽`)ノ” 17 | } 18 | -------------------------------------------------------------------------------- /N/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.util.HashSet; 2 | import java.util.Map; 3 | import java.util.Set; 4 | import java.util.HashMap; 5 | 6 | /** 7 | public class Node { 8 | 9 | public final int val; 10 | public final List neighbours; 11 | 12 | public Node(int val) { 13 | this.val = val; 14 | this.neighbours = new ArrayList<>(); 15 | } 16 | } 17 | */ 18 | 19 | public class Solution { 20 | public static Node cloneGraph(Node node) { 21 | // Your code 22 | // “ヽ(´▽`)ノ” 23 | } 24 | } -------------------------------------------------------------------------------- /N/js/code.js: -------------------------------------------------------------------------------- 1 | 2 | /* Comment it before submitting 3 | class Node { 4 | constructor(val) { 5 | this.val = val; 6 | this.neighbours = []; 7 | } 8 | } 9 | */ 10 | 11 | /** 12 | * @param {Node} node 13 | * @return {Node} 14 | */ 15 | var cloneGraph = function(node) { 16 | // Your code 17 | // “ヽ(´▽`)ノ” 18 | }; -------------------------------------------------------------------------------- /N/python/code.py: -------------------------------------------------------------------------------- 1 | from node import Node 2 | 3 | # Comment it before submitting 4 | # class Node: 5 | # def __init__(self, val): 6 | # self.val = val 7 | # self.neighbours = [] 8 | 9 | 10 | 11 | def cloneGraph(node) -> Node: 12 | # Your code 13 | # “ヽ(´▽`)ノ” 14 | pass 15 | -------------------------------------------------------------------------------- /O/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | 7 | struct Building { 8 | int needCapital; 9 | int addedCapital; 10 | 11 | Building(int c, int p) { 12 | needCapital = c; 13 | addedCapital = p; 14 | } 15 | }; 16 | 17 | 18 | long long getMaxFinalCapital(const vector& buildings, int startCapital, int maxNumberOfBuildings) { 19 | // your code goes here 20 | return 0; 21 | } 22 | 23 | 24 | vector readBuildings(int n) { 25 | vector buildings; 26 | for (int i = 0; i < n; i++) { 27 | int c, p; 28 | cin >> c >> p; 29 | buildings.push_back(Building(c, p)); 30 | } 31 | return buildings; 32 | } 33 | 34 | int main() { 35 | int n; 36 | cin >> n; 37 | int k; 38 | cin >> k; 39 | vector buildings = readBuildings(n); 40 | int M; 41 | cin >> M; 42 | cout << getMaxFinalCapital(buildings, M, k) << endl; 43 | } 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /O/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.IOException; 3 | import java.io.InputStreamReader; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.List; 7 | import java.util.stream.Collectors; 8 | 9 | 10 | public class Solution { 11 | 12 | private static long getMaxFinalCapital(List buildings, int startCapital, int maxNumberOfBuildings) { 13 | // your code goes here 14 | return 0; 15 | } 16 | public static void main(String[] args) throws IOException { 17 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 18 | List nAndK = readTwoNumbers(reader); 19 | int n = nAndK.get(0); 20 | int k = nAndK.get(1); 21 | List buildings = readBuildings(reader, n); 22 | int M = readInt(reader); 23 | System.out.println(getMaxFinalCapital(buildings, M, k)); 24 | } 25 | } 26 | 27 | private static List readBuildings(BufferedReader reader, int n) throws IOException { 28 | List buildings = new ArrayList<>(n); 29 | for (int i = 0; i < n; i++) { 30 | List parameters = readTwoNumbers(reader); 31 | buildings.add(new Building(parameters.get(0), parameters.get(1))); 32 | } 33 | return buildings; 34 | } 35 | 36 | private static int readInt(BufferedReader reader) throws IOException { 37 | return Integer.parseInt(reader.readLine()); 38 | } 39 | 40 | private static List readTwoNumbers(BufferedReader reader) throws IOException { 41 | return Arrays.asList(reader.readLine().strip().split(" ")) 42 | .stream() 43 | .map(elem -> Integer.parseInt(elem)) 44 | .collect(Collectors.toList()); 45 | } 46 | 47 | private static class Building { 48 | public final int needCapital; 49 | public final int addedCapital; 50 | 51 | public Building(int c, int p) { 52 | needCapital = c; 53 | addedCapital = p; 54 | } 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /O/js/code.js: -------------------------------------------------------------------------------- 1 | class Building { 2 | constructor(needCapital, addedCapital) { 3 | this.needCapital = needCapital; 4 | this.addedCapital = addedCapital; 5 | } 6 | } 7 | 8 | function getMaxFinalCapital(buildings, startCapital, maxNumberOfBuildings) { 9 | // your code goes here 10 | return 0; 11 | } 12 | 13 | const _readline = require('readline'); 14 | 15 | const _reader = _readline.createInterface({ 16 | input: process.stdin 17 | }); 18 | 19 | const _inputLines = []; 20 | let _curLine = 0; 21 | 22 | _reader.on('line', line => { 23 | _inputLines.push(line); 24 | }); 25 | 26 | process.stdin.on('end', solve); 27 | 28 | 29 | function solve() { 30 | const nAndK = readArray(); 31 | const n = nAndK[0]; 32 | const k = nAndK[1]; 33 | const buildings = readBuildings(n); 34 | const M = readInt(); 35 | console.log(getMaxFinalCapital(buildings, M, k)); 36 | } 37 | 38 | function readInt() { 39 | const n = Number(_inputLines[_curLine]); 40 | _curLine++; 41 | return n; 42 | } 43 | 44 | function readArray() { 45 | var arr = _inputLines[_curLine].trim(" ").split(" ").map(num => Number(num)); 46 | _curLine++; 47 | return arr; 48 | } 49 | 50 | function readBuildings(n) { 51 | let buildings = []; 52 | for (let i = 0; i < n; i++) { 53 | let parameters = readArray(); 54 | buildings.push(new Building(parameters[0], parameters[1])); 55 | } 56 | return buildings; 57 | } -------------------------------------------------------------------------------- /O/python/code.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | 4 | class Building: 5 | def __init__(self, need_capital, added_capital) -> None: 6 | self.need_capital = need_capital 7 | self.added_capital = added_capital 8 | 9 | 10 | 11 | def get_max_final_capital(buildings: List[Building], start_capital: int, max_buildings: int) -> int: 12 | # your code goes here 13 | return 0 14 | 15 | n, k = map(int, input().split()) 16 | buildings = [] 17 | for i in range(n): 18 | c, p = map(int, input().split()) 19 | buildings.append(Building(c, p)) 20 | M = int(input()) 21 | print(get_max_final_capital(buildings, M, k)) 22 | -------------------------------------------------------------------------------- /P/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | struct Vertex { 7 | int left; 8 | int right; 9 | 10 | Vertex(int left, int right) : left(left), right(right) { 11 | } 12 | }; 13 | 14 | 15 | vector getTreeBorder(const vector& tree, int root) { 16 | // your code goes here 17 | return {}; 18 | } 19 | 20 | void outputAnswer(const vector& treeBorder) { 21 | for (int elem : treeBorder) { 22 | cout << elem << " "; 23 | } 24 | cout << endl; 25 | } 26 | 27 | vector readTree(int n) { 28 | vector tree; 29 | for (int i = 0; i < n; i++) { 30 | int left, right; 31 | cin >> left >> right; 32 | tree.push_back(Vertex(left, right)); 33 | } 34 | return tree; 35 | } 36 | 37 | int main() { 38 | int n; 39 | cin >> n; 40 | int root; 41 | cin >> root; 42 | vector tree = readTree( n); 43 | outputAnswer(getTreeBorder(tree, root)); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /P/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.BufferedWriter; 3 | import java.io.IOException; 4 | import java.io.InputStreamReader; 5 | import java.io.OutputStreamWriter; 6 | import java.util.ArrayList; 7 | import java.util.Arrays; 8 | import java.util.List; 9 | import java.util.stream.Collectors; 10 | 11 | 12 | public class Solution { 13 | 14 | private static List getTreeBorder(List tree, int root) { 15 | // your code goes here 16 | return List.of(); 17 | } 18 | 19 | public static void main(String[] args) { 20 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); 21 | BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out))) { 22 | List firstLine = readTwoNumbers(reader); 23 | int n = firstLine.get(0); 24 | int root = firstLine.get(1); 25 | List tree = readTree(reader, n); 26 | outputAnswer(getTreeBorder(tree, root), writer); 27 | } 28 | } 29 | 30 | 31 | private static void outputAnswer(List treeBorder, BufferedWriter writer) { 32 | for (int elem : treeBorder) { 33 | writer.write(elem + " "); 34 | } 35 | writer.write("\n"); 36 | } 37 | 38 | private static List readTree(BufferedReader reader, int n) throws IOException { 39 | List tree = new ArrayList<>(n); 40 | for (int i = 0; i < n; i++) { 41 | List leftAndRight = readTwoNumbers(reader); 42 | tree.add(new Vertex(leftAndRight.get(0), leftAndRight.get(1))); 43 | } 44 | return tree; 45 | } 46 | 47 | private static List readTwoNumbers(BufferedReader reader) throws IOException { 48 | return Arrays.asList(reader.readLine().strip().split(" ")) 49 | .stream() 50 | .map(elem -> Integer.parseInt(elem)) 51 | .collect(Collectors.toList()); 52 | } 53 | 54 | private static class Vertex { 55 | public final int left; 56 | public final int right; 57 | 58 | public Vertex(int left, int right) { 59 | this.left = left; 60 | this.right = right; 61 | } 62 | } 63 | 64 | } -------------------------------------------------------------------------------- /P/js/code.js: -------------------------------------------------------------------------------- 1 | class Vertex { 2 | constructor(left, right) { 3 | this.left = left; 4 | this.right = right; 5 | } 6 | } 7 | 8 | function getTreeBorder(tree, root) { 9 | // your code goes here 10 | return []; 11 | } 12 | 13 | const _readline = require('readline'); 14 | 15 | const _reader = _readline.createInterface({ 16 | input: process.stdin 17 | }); 18 | 19 | const _inputLines = []; 20 | let _curLine = 0; 21 | 22 | _reader.on('line', line => { 23 | _inputLines.push(line); 24 | }); 25 | 26 | process.stdin.on('end', solve); 27 | 28 | function readTree(n) { 29 | const tree = []; 30 | for (let i = 0; i < n; i++) { 31 | const leftAndRight = readArray(); 32 | tree.push(new Vertex(leftAndRight[0], leftAndRight[1])); 33 | } 34 | return tree; 35 | } 36 | 37 | function solve() { 38 | const firstLine = readArray(); 39 | const n = firstLine[0]; 40 | const root = firstLine[1]; 41 | const tree = readTree(n); 42 | outputAnswer(getTreeBorder(tree, root)); 43 | } 44 | 45 | function readInt() { 46 | const n = Number(_inputLines[_curLine]); 47 | _curLine++; 48 | return n; 49 | } 50 | 51 | function readArray() { 52 | var arr = _inputLines[_curLine].trim(" ").split(" ").map(num => Number(num)); 53 | _curLine++; 54 | return arr; 55 | } 56 | 57 | function outputAnswer(border) { 58 | process.stdout.write(`${border.join(' ')}`); 59 | } -------------------------------------------------------------------------------- /P/python/code.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | 4 | class Node: 5 | def __init__(self) -> None: 6 | self.left = None 7 | self.right = None 8 | 9 | 10 | def get_tree_border(root: Node) -> List[int]: 11 | # your code goes here 12 | return [] 13 | 14 | def read_tree() -> Node: 15 | size, root_id = map(int, input().split()) 16 | nodes = [Node(None, None) for i in range(size)] 17 | for i in range(size): 18 | left, right = map(int, input().split()) 19 | nodes[i].left = nodes[left] if left != -1 else None 20 | nodes[i].right = nodes[right] if right != -1 else None 21 | return nodes[root_id] 22 | 23 | 24 | tree = read_tree() 25 | -------------------------------------------------------------------------------- /Q/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | struct Point { 7 | int x; 8 | int y; 9 | 10 | Point(int x, int y): x(x), y(y) { 11 | } 12 | }; 13 | 14 | 15 | bool isOnOneLine(const vector& points) { 16 | // your code goes here 17 | return false; 18 | } 19 | 20 | int main() { 21 | int n; 22 | cin >> n; 23 | vector points; 24 | for (int i = 0; i < n; i++) { 25 | int x, y; 26 | cin >> x >> y; 27 | points.push_back(Point(x, y)); 28 | } 29 | if (isOnOneLine(points)) { 30 | cout << "YES"; 31 | } else { 32 | cout << "NO"; 33 | } 34 | } -------------------------------------------------------------------------------- /Q/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.util.List; 2 | import java.util.ArrayList; 3 | import java.util.Arrays; 4 | import java.util.stream.Collectors; 5 | import java.io.BufferedReader; 6 | import java.io.BufferedWriter; 7 | import java.io.IOException; 8 | import java.io.InputStreamReader; 9 | import java.io.OutputStreamWriter; 10 | 11 | 12 | public class Solution { 13 | 14 | private static boolean isOnOneLine(List points) { 15 | // your code goes here 16 | return false; 17 | } 18 | 19 | public static void main(String[] args) throws IOException { 20 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 21 | int n = readInt(reader); 22 | List points = new ArrayList<>(); 23 | for (int i = 0; i < n; i++) { 24 | List coordinates = readTwoNumbers(reader); 25 | points.add(new Point(coordinates.get(0), coordinates.get(1))); 26 | } 27 | if (isOnOneLine(points)) { 28 | System.out.println("YES"); 29 | } else { 30 | System.out.println("NO"); 31 | } 32 | 33 | } 34 | } 35 | 36 | private static int readInt(BufferedReader reader) throws IOException { 37 | return Integer.parseInt(reader.readLine()); 38 | } 39 | 40 | private static List readTwoNumbers(BufferedReader reader) throws IOException { 41 | return Arrays.asList(reader.readLine().strip().split(" ")) 42 | .stream() 43 | .map(elem -> Integer.parseInt(elem)) 44 | .collect(Collectors.toList()); 45 | } 46 | 47 | public static class Point { 48 | public final int x; 49 | public final int y; 50 | 51 | public Point(int x, int y) { 52 | this.x = x; 53 | this.y = y; 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /Q/js/code.js: -------------------------------------------------------------------------------- 1 | class Point { 2 | constructor(x, y) { 3 | this.x = x; 4 | this.y = y; 5 | } 6 | } 7 | 8 | function isOnOneLine(points) { 9 | // your code goes here 10 | return false; 11 | } 12 | 13 | const _readline = require('readline'); 14 | 15 | const _reader = _readline.createInterface({ 16 | input: process.stdin 17 | }); 18 | 19 | const _inputLines = []; 20 | let _curLine = 0; 21 | 22 | _reader.on('line', line => { 23 | _inputLines.push(line); 24 | }); 25 | 26 | process.stdin.on('end', solve); 27 | 28 | function solve() { 29 | const n = readInt(); 30 | const points = []; 31 | for (let i = 0; i < n; i++) { 32 | const coordinates = readArray(); 33 | points.push(new Point(coordinates[0], coordinates[1])); 34 | } 35 | if (isOnOneLine(points)) { 36 | console.log("YES"); 37 | } else { 38 | console.log("NO"); 39 | } 40 | } 41 | 42 | function readInt() { 43 | const n = Number(_inputLines[_curLine]); 44 | _curLine++; 45 | return n; 46 | } 47 | 48 | function readArray() { 49 | var arr = _inputLines[_curLine].trim(" ").split(" ").map(num => Number(num)); 50 | _curLine++; 51 | return arr; 52 | } -------------------------------------------------------------------------------- /Q/python/code.py: -------------------------------------------------------------------------------- 1 | from typing import List, Tuple 2 | 3 | 4 | def is_on_one_line(points: List[Tuple[int]]) -> bool: 5 | # your code goes here 6 | return False 7 | 8 | n = int(input()) 9 | points = [] 10 | for i in range(n): 11 | x, y = map(int, input().split()) 12 | points.append((x, y)) 13 | 14 | if is_on_one_line(points): 15 | print('YES') 16 | else: 17 | print('NO') -------------------------------------------------------------------------------- /R/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | 7 | bool isPashaWins(int n) { 8 | // Your code here 9 | return true; 10 | } 11 | 12 | int main() { 13 | int n; 14 | cin >> n; 15 | if (isPashaWins(n)) { 16 | cout << "Pasha"; 17 | } else { 18 | cout << "Mark"; 19 | } 20 | } -------------------------------------------------------------------------------- /R/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.util.stream.Collectors; 2 | import java.io.BufferedReader; 3 | import java.io.BufferedWriter; 4 | import java.io.IOException; 5 | import java.io.InputStreamReader; 6 | import java.io.OutputStreamWriter; 7 | 8 | 9 | public class Solution { 10 | 11 | private static boolean isPashaWins(int n) { 12 | // Your code here 13 | return true; 14 | } 15 | 16 | public static void main(String[] args) throws IOException { 17 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 18 | int n = readInt(reader); 19 | if (isPashaWins(n)) { 20 | System.out.println("Pasha"); 21 | } else { 22 | System.out.println("Mark"); 23 | } 24 | } 25 | } 26 | 27 | private static int readInt(BufferedReader reader) throws IOException { 28 | return Integer.parseInt(reader.readLine()); 29 | } 30 | } -------------------------------------------------------------------------------- /R/js/code.js: -------------------------------------------------------------------------------- 1 | function isPashaWins(n) { 2 | // your code goes here 3 | return false; 4 | } 5 | 6 | const _readline = require('readline'); 7 | 8 | const _reader = _readline.createInterface({ 9 | input: process.stdin 10 | }); 11 | 12 | const _inputLines = []; 13 | let _curLine = 0; 14 | 15 | _reader.on('line', line => { 16 | _inputLines.push(line); 17 | }); 18 | 19 | process.stdin.on('end', solve); 20 | 21 | function solve() { 22 | const n = readInt(); 23 | if (isPashaWins(n)) { 24 | console.log("Pasha"); 25 | } else { 26 | console.log("Mark"); 27 | } 28 | } 29 | 30 | function readInt() { 31 | const n = Number(_inputLines[_curLine]); 32 | _curLine++; 33 | return n; 34 | } -------------------------------------------------------------------------------- /R/python/code.py: -------------------------------------------------------------------------------- 1 | def is_pasha_wins(n: int) -> bool: 2 | # your code goes here 3 | return False 4 | 5 | n = int(input()) 6 | if is_pasha_wins(n): 7 | print('Pasha') 8 | else: 9 | print('Mark') -------------------------------------------------------------------------------- /S/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | using namespace std; 5 | 6 | const string IPV4 = "IPv4"; 7 | const string IPV6 = "IPv6"; 8 | const string ERROR = "Error"; 9 | 10 | /** 11 | * return IPV4,IPV6, or ERROR 12 | */ 13 | string checkIpAddress(const string& ip) { 14 | // Your code here 15 | return ERROR; 16 | } 17 | 18 | int main() { 19 | string ipAddress; 20 | cin >> ipAddress; 21 | cout << checkIpAddress(ipAddress); 22 | } -------------------------------------------------------------------------------- /S/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.BufferedWriter; 3 | import java.io.IOException; 4 | import java.io.InputStreamReader; 5 | import java.io.OutputStreamWriter; 6 | 7 | 8 | public class Solution { 9 | 10 | private static final String IPV4 = "IPv4"; 11 | private static final String IPV6 = "IPv6"; 12 | private static final String ERROR = "Error"; 13 | 14 | /** 15 | * @return R.java#IPV4, R.java#IPV6, or R.java#ERROR 16 | */ 17 | private static String checkIpAddress(String ip) { 18 | // Your code here 19 | return ERROR; 20 | } 21 | 22 | public static void main(String[] args) throws IOException { 23 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 24 | String ipAddress = reader.readLine(); 25 | System.out.println(checkIpAddress(ipAddress)); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /S/js/code.js: -------------------------------------------------------------------------------- 1 | const IPV4 = "IPv4"; 2 | const IPV6 = "IPv6"; 3 | const ERROR = "Error"; 4 | 5 | function checkIpAddress(ip) { 6 | // your code goes here 7 | return ERROR; 8 | } 9 | 10 | const _readline = require('readline'); 11 | 12 | 13 | const _reader = _readline.createInterface({ 14 | input: process.stdin 15 | }); 16 | 17 | const _inputLines = []; 18 | let _curLine = 0; 19 | 20 | _reader.on('line', line => { 21 | _inputLines.push(line); 22 | }); 23 | 24 | process.stdin.on('end', solve); 25 | 26 | function solve() { 27 | const ip = readLine(); 28 | console.log(checkIpAddress(ip)); 29 | } 30 | 31 | function readInt() { 32 | const n = Number(_inputLines[_curLine]); 33 | _curLine++; 34 | return n; 35 | } 36 | 37 | function readLine() { 38 | const line = _inputLines[_curLine]; 39 | _curLine++; 40 | return line; 41 | } -------------------------------------------------------------------------------- /S/python/code.py: -------------------------------------------------------------------------------- 1 | IPV4 = "IPv4" 2 | IPV6 = "IPv6" 3 | ERROR = "Error" 4 | 5 | # return IPV4, IPV6 or ERROR constant 6 | def check_ip_address(ip_to_check: str) -> str: 7 | # your code goes here 8 | return ERROR 9 | 10 | ip_to_check = input() 11 | print(check_ip_address(ip_to_check)) -------------------------------------------------------------------------------- /T/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | 7 | long long getMaxXOR(const vector& list) { 8 | // your code goes here 9 | return 0; 10 | } 11 | 12 | vector readList() { 13 | int n; 14 | cin >> n; 15 | vector res(n); 16 | for (int i = 0; i < n; i++) { 17 | cin >> res[i]; 18 | } 19 | return res; 20 | } 21 | 22 | int main() { 23 | vector list = readList(); 24 | cout << getMaxXOR(list); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /T/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.IOException; 3 | import java.io.InputStreamReader; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.List; 7 | import java.util.stream.Collectors; 8 | 9 | 10 | public class Solution { 11 | 12 | private static long getMaxXOR(List list) { 13 | // your code goes here 14 | return 0; 15 | } 16 | 17 | public static void main(String[] args) throws IOException { 18 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { 19 | List list = readList(reader); 20 | System.out.println(getMaxXOR(list)); 21 | } 22 | } 23 | 24 | private static List readList(BufferedReader reader) throws IOException { 25 | reader.readLine(); 26 | return Arrays.asList(reader.readLine().strip().split(" ")) 27 | .stream() 28 | .map(token -> Integer.parseInt(token)) 29 | .collect(Collectors.toList()); 30 | } 31 | } -------------------------------------------------------------------------------- /T/js/code.js: -------------------------------------------------------------------------------- 1 | function getMaxXOR(numbers) { 2 | // your code goes here 3 | return 0; 4 | } 5 | 6 | const _readline = require('readline'); 7 | 8 | const _reader = _readline.createInterface({ 9 | input: process.stdin 10 | }); 11 | 12 | const _inputLines = []; 13 | let _curLine = 0; 14 | 15 | _reader.on('line', line => { 16 | _inputLines.push(line); 17 | }); 18 | 19 | process.stdin.on('end', solve); 20 | 21 | function solve() { 22 | const n = readInt(); 23 | const list = readArray(); 24 | console.log(getMaxXOR(list)); 25 | } 26 | 27 | function readInt() { 28 | const n = Number(_inputLines[_curLine]); 29 | _curLine++; 30 | return n; 31 | } 32 | 33 | function readArray() { 34 | var arr = _inputLines[_curLine].trim(" ").split(" ").map(num => Number(num)); 35 | _curLine++; 36 | return arr; 37 | } -------------------------------------------------------------------------------- /T/python/code.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | 4 | def get_max_xor(numbers: List[int]) -> int: 5 | # your code goes here 6 | return 0 7 | 8 | n = int(input()) 9 | numbers = list(map(int, input().split())) 10 | print(get_max_xor(numbers)) -------------------------------------------------------------------------------- /U/cpp/code.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | void outputAnswer(const vector& sequences) { 7 | for (const string& sequence : sequences) { 8 | cout << sequence << " "; 9 | } 10 | } 11 | 12 | vector generateSequences(int n) { 13 | // Your code here 14 | return {}; 15 | } 16 | 17 | int main() { 18 | int n; 19 | cin >> n; 20 | outputAnswer(generateSequences(n)); 21 | } -------------------------------------------------------------------------------- /U/java/Solution.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.BufferedWriter; 3 | import java.io.IOException; 4 | import java.io.InputStreamReader; 5 | import java.io.OutputStreamWriter; 6 | import java.util.ArrayList; 7 | import java.util.Arrays; 8 | import java.util.List; 9 | import java.util.stream.Collectors; 10 | 11 | 12 | public class Solution { 13 | 14 | private static List generateSequences(int n) { 15 | // Your code here 16 | return List.of(); 17 | } 18 | 19 | public static void main(String[] args) throws IOException { 20 | try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); 21 | BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out))) { 22 | int n = readInt(reader); 23 | outputAnswer(generateSequences(n), writer); 24 | } 25 | } 26 | 27 | private static void outputAnswer(List sequences, BufferedWriter writer) throws IOException { 28 | for (String sequence : sequences) { 29 | writer.write(sequence + "\n"); 30 | } 31 | } 32 | 33 | private static int readInt(BufferedReader reader) throws IOException { 34 | return Integer.parseInt(reader.readLine()); 35 | } 36 | } -------------------------------------------------------------------------------- /U/js/code.js: -------------------------------------------------------------------------------- 1 | function generateSequences(n) { 2 | // your code goes here 3 | return []; 4 | } 5 | 6 | const _readline = require('readline'); 7 | 8 | 9 | const _reader = _readline.createInterface({ 10 | input: process.stdin 11 | }); 12 | 13 | const _inputLines = []; 14 | let _curLine = 0; 15 | 16 | _reader.on('line', line => { 17 | _inputLines.push(line); 18 | }); 19 | 20 | process.stdin.on('end', solve); 21 | 22 | 23 | function solve() { 24 | const n = readInt(); 25 | outputAnswer(generateSequences(n)); 26 | } 27 | 28 | function readInt() { 29 | const n = Number(_inputLines[_curLine]); 30 | _curLine++; 31 | return n; 32 | } 33 | 34 | function outputAnswer(sequences) { 35 | for (let sequence of sequences) { 36 | process.stdout.write(`${sequence.join(' ')}\n`); 37 | } 38 | } -------------------------------------------------------------------------------- /U/python/code.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | 4 | def generate_sequences(n: int) -> List[str]: 5 | # your code goes here 6 | return [] 7 | 8 | n = int(input()) 9 | sequnces = generate_sequences(n) 10 | for seq in sequnces: 11 | print(seq) 12 | --------------------------------------------------------------------------------