• 2024-06-22kedaOJ#P1529有趣的字母
    题目kedaOJ#P1529有趣的字母思路直接模拟,比较复杂的是找到最后一个字符代码#include<bits/stdc++.h>intmain(){std::vector<char>vowels={'a','e','i','o','u'};intn;std::cin>>n;intcount
  • 2024-06-07LeetCode 2559. 统计范围内的元音字符串数
    2559.统计范围内的元音字符串数给你一个下标从 0 开始的字符串数组 words 以及一个二维整数数组 queries 。每个查询 queries[i]=[li,ri] 会要求我们统计在 words 中下标在 li 到 ri 范围内(包含 这两个值)并且以元音开头和结尾的字符串的数目。返回一个整
  • 2024-02-04[CF383E] Vowels 题解
    [CF383E]Vowels题解思路要求的这个东西一看就没什么性质,考虑枚举所有元音子集。如果我们能够求出\(f_s\)表示\(s\)集合作为元音时有多少个单词至少包含一个元音。难求,正难则反,考虑\(f_s\)表示\(s\)集合作为元音时有多少个单词全都由非元音字母组成,由于对称性,我们只
  • 2023-11-28Count Beautiful Substrings II
    CountBeautifulSubstringsIIYouaregivenastring s andapositiveinteger k.Let vowels and consonants bethenumberofvowelsandconsonantsinastring.Astringis beautiful if:vowels==consonants.(vowels*consonants)%k==0,inothert
  • 2023-11-14[LeetCode] 2785. Sort Vowels in a String
    Givena0-indexedstrings,permutestogetanewstringtsuchthat:Allconsonantsremainintheiroriginalplaces.Moreformally,ifthereisanindexiwith0<=i<s.lengthsuchthats[i]isaconsonant,thent[i]=s[i].Thevowelsmustbes
  • 2023-05-30leetcode 345. Reverse Vowels of a String
    Writeafunctionthattakesastringasinputandreverseonlythevowelsofastring.Example1:Givens="hello",return"holle".Example2:Givens="leetcode",return"leotcede".Note:Thevowelsdoesnotincl
  • 2023-05-25周四
    题目描述:给定一个字符串s,你需要反转其中所有的元音字母。示例1:输入:"hello"输出:"holle"示例2:输入:"leetcode"输出:"leotcede"设计思路:首先,我们需要明确什么是元音字母,即a、e、i、o、u这五个字母。接下来,我们可以使用双指针的方法,一个指针从字符串头部开始,一个
  • 2023-04-12UVa 10785 The Mad Numerologist (排序)
    10785-TheMadNumerologistTimelimit:3.000secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=98&page=show_problem&problem=1726Numerologyisasciencethatisusedbymanypeopletofindoutamansper
  • 2023-03-21python常见函数
    python常见函数1.sort()函数描述:用于对原列表进行排序语法:list.sort(key=None,reverse=False)key主要是用来进行比较的元素,只有一个参数,具体的函数的参数就是取自
  • 2023-03-17Disemvowel Trolls
    InstructionsTrollsareattackingyourcommentsection!Acommonwaytodealwiththissituationistoremoveallofthevowelsfromthetrolls'comments,neut
  • 2023-03-07Python中Index的用法
    1.Index常用于Python的List数据类型在Python中有一种数据类型叫作List数据类型。程序员口中和中文翻译过来都称之为List数据类型,而Index主要用于List数据类型中。Index