Kotlin入门语法 1.Kotli中的变量/*在Kotlin中,变量只分为val和var.而val变量只能被赋值一次,相当于在初始化进行赋值后,后续就不能改动该变量。而var变量是能够重复赋值。例:val a = 1var a1 = 2在Kotlin中,常用的变量类型有:Int (整数类型)String (字符串类型)Boolean (布尔值类型)Double (浮点数类型)*/2.Kotlin中的函数函数声明:fun + 函数名(参数类型):返回值例子:fun xiaosu(su:S
每日一练~Shortest Path~解题报告 Shortest Path文章目录Shortest Path题目描述:Input:Output:Sample Input:Sample Output:Hint:题目大意:思路分析:代码:题目描述:Today HH becomes a designer, and he faces a problem so he asks you for help.Treeisland is a countr...
Codeforces Round #631(div.2) A~B A:Dreamoon and Ranking Collection文章目录A:Dreamoon and Ranking Collection题目描述:Input:Output:Sample Input:Sample Output:Hint:题目大意:思路分析:代码:B:Dreamoon Likes Permutations题目描述:Input:Output:Sample Input:Sample...
线段树训练~敌兵布阵~单节点操作~解题报告 敌兵布阵文章目录敌兵布阵题目描述:Input:Output:Sample Input:Sample Output:线段树问题引入:代码:题目描述:C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数...
查并集训练~How Many Tables~解题报告 How Many Tables文章目录How Many Tables题目描述:Input:Output:Sample Input:Sample Output:思路:代码:题目描述:Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how ...
DP训练~Robberies~解题报告 Robberies文章目录Robberies题目描述:Input:Output:Sample Input:Sample Output:题目大意:思路分析:代码:题目描述:The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught i...
KMP训练~Oulipo~解题报告 Oulipo文章目录Oulipo题目描述:Input:Output:题目大意:思路分析:代码:题目描述:The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter ‘e’. He was a member of the Oulipo group. A quo...
KMP训练~Number Sequence~解题报告 Number Sequence文章目录Number Sequence题目描述:Input:Output:Sample Input:Sample Output:题目大意:思路分析:代码:题目描述:Given two sequences of numbers : a[1], a[2], … , a[N], and b[1], b[2], … , b[M] (1 <= M <= 100...
Doors Breaking and Repairing(补题)~解题报告 Doors Breaking and Repairing文章目录Doors Breaking and Repairing题目描述:Input:Output:Sample Input:Sample Output:Sample Input:Sample Output:Sample Input:Sample Output:题目大意:思路分析:代码:题目描述:You are policeman an...
POJ~1077~八数码~DFS解题报告 八数码:文章目录八数码:题目描述:Input:Output:Sample Input:Sample Output:题目大意:思路分析:代码:题目描述:The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructe...
POJ~1077~八数码~IDA*解题报告 八数码:文章目录八数码:题目描述:Input:Output:Sample Input:Sample Output:题目大意:思路分析:代码:题目描述:The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructe...
Prison Transfer~解题报告 Prison Transfer文章目录Prison Transfer题目描述:Input:Output:Sample Input:Sample Output:Sample Input:Sample Output:Sample Input:Sample Output:题目描述:思路分析:代码:题目描述:The prison of your city has n prisoners. As th...
Kuroni and Impossible Calculation(补题)~解题报告 Kuroni and Impossible Calculation文章目录Kuroni and Impossible Calculation题目描述:Input:Output:Sample Input:Sample Output:Sample Input:Sample Output:Sample Input:Sample Output:题目描述:思路分析:代码:题目描述:To become ...
Kuroni and Simple Strings(补题)~解题报告 Kuroni and Simple Strings文章目录Kuroni and Simple Strings题目描述:Input:Output:Sample Input:Sample Output:Sample Input:Smaple Output:Sample Input:Sample Output:题目大意:思路分析:代码:题目描述:Now that Kuroni has reache...
Kuroni and the Gifts(补题) Kuroni and the Gifts文章目录Kuroni and the Gifts题目描述:Input:Output:Sample Input:Sample Output:题目分析:思路分析:代码:题目描述:Kuroni has nn daughters. As gifts for them, he bought nn necklaces and nn bracelets:the i...
Palindromic Matrix~解题报告 Palindromic Matrix文章目录Palindromic Matrix题目描述:Input:Output:Sample Input:Sample Output:Sample Input:Sample Output:Sample Input:Sample Output:Sample Input:Sample Output:题目描述:思路分析:代码:题目描述:Let’s call so...
PIN Codes~解题报告 PIN Codes文章目录PIN Codes题目描述:Input:Output:Sample Input:Sample Output:题目大意:思路分析:代码:题目描述:A PIN code is a string that consists of exactly 44 digits. Examples of possible PIN codes: 7013, 0000 and 0990. ...
最大子列和问题~解题报告 最大子列和问题题目描述:给定K个整数组成的序列{ N1, N2, …, NK },“连续子列”被定义为{ Ni, Ni+1, …, Nj},其中 1≤i≤j≤K。“最大子列和”则被定义为所有连续子列元素的和中最大者。例如给定序列{ -2, 11, -4, 13, -5, -2 },其连续子列{ 11, -4, 13 }有最大的和20。现要求你编写程序,计算给定整数序列的最大子列和。本题旨...
DP训练~Bone Collector(入门)~解题报告 Bone Collector题目描述:Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave ...
DP训练~Tri Tiling(入门)~解题报告 Tri Tiling文章目录Tri Tiling题目描述:Input:Output:Smaple Input:Sample Output:题目大意:思路分析:题目描述:Input:Input consists of several test cases followed by a line containing -1. Each test case is a line containi...