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
| private var map = arrayOf<IntArray>() | |
| private var visited = arrayOf<BooleanArray>() | |
| private var n = 0 | |
| private var m = 0 | |
| private val dx = arrayOf(-1, 1, 0, 0) | |
| private val dy = arrayOf(0, 0, -1, 1) | |
| fun main() = with(System.`in`.bufferedReader()) { | |
| val tc = readLine().toInt() |
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
| #include <string> | |
| #include <vector> | |
| #define MAX 200 | |
| using namespace std; | |
| bool visited[MAX]; | |
| void dfs(vector<vector<int>> &computers, int now) { | |
| visited[now] = true; |
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
| #include <iostream> | |
| #include <cstring> | |
| #define MAX 101 | |
| using namespace std; | |
| int n; | |
| char map[MAX][MAX]; | |
| bool visited[MAX][MAX]; | |
| int dx[] = { -1, 1, 0, 0 }; |
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
| 🌞 Morning 36 commits █▎░░░░░░░░░░░░░░░░░░░ 6.3% | |
| 🌆 Daytime 93 commits ███▍░░░░░░░░░░░░░░░░░ 16.4% | |
| 🌃 Evening 372 commits █████████████▊░░░░░░░ 65.5% | |
| 🌙 Night 67 commits ██▍░░░░░░░░░░░░░░░░░░ 11.8% |
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
| val numbers : List<String> = listOf("one", "two", "three", "four") | |
| // val numbers = listOf("one", "two", "three", "four") | |
| println("Number of elements: ${numbers.size}") | |
| println("Third element: ${numbers.get(2)}") | |
| println("Fourth element: ${numbers[3]}") | |
| println("Index of element \"two\" ${numbers.indexOf("two")}") |
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
| #include <iostream> | |
| #include <algorithm> | |
| using namespace std; | |
| int cnt[101]; | |
| int main() | |
| { | |
| int T, k; | |
| cin>>T; |
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
| void bubbleSort(int[] arr) { | |
| int temp = 0; | |
| for(int i = 0; i < arr.length; i++) { // 1. | |
| for(int j= 1 ; j < arr.length-i; j++) { // 2. | |
| if(arr[j-1] > arr[j]) { // 3. | |
| // swap(arr[j-1], arr[j]) | |
| temp = arr[j-1]; | |
| arr[j-1] = arr[j]; | |
| arr[j] = temp; | |
| } |
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.* | |
| fun main() { | |
| val sc = Scanner(System.`in`) | |
| while (true) { | |
| val result = sum(sc.nextInt(), sc.nextInt()) | |
| if (result == 0) | |
| break | |
| println(result) | |
| } |