- 博客(3)
- 收藏
- 关注
原创 按出现频率高低输出字母,给出字典序列
按出现频率高低输出字母,给出字典序列 使用一个数组num存储每个字母出现的次数,随后遍历26次num数组,每次寻找当前数组中最大数,根据数组下标key得到字母,根据num[key]的值得到原串中出现的次数,结果存入res字符串。每次结束后,将num[key]置零 T(n)=O(n)+O(26*T(26))=O(n)+O(1)=O(n) S(n)=O(1) import java.util.Scanner; public class tongjipaixu { public static
2021-03-24 23:29:06
446
原创 WOJ1062
Long time ago, people used to believe that they live on 2D world and if they will travel long enough in one direction, they will fall down over the edge. Even when it was proved that the Earth is rounded some of them were still afraid to travel to sout.
2021-01-02 20:51:52
210
原创 woj1264
#include<stdio.h> #include<stdlib.h> int MM1[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 }; int MM2[12] = { 31,29,31,30,31,30,31,31,30,31,30,31 }; int n; int getY() { int year=2000; while (n >= 0) { if ((year % 4 == 0 &a...
2021-01-02 13:55:28
146
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人