map哈希存储 摘要:参考代码:#include<bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n) { if…… 题解列表 2024年09月15日 0 点赞 0 评论 393 浏览 评分:0.0
编写题解 1461: 蓝桥杯基础练习VIP-FJ的字符串 摘要:解题思路:参考代码:import java.util.Scanner; public class Main { public static void main(String[] args) …… 题解列表 2024年09月14日 0 点赞 0 评论 440 浏览 评分:9.9
编写题解 1458: 蓝桥杯2013年第四届真题-错误票据-Java代码 摘要:解题思路:注意事项:参考代码:import java.util.Scanner; import java.util.Arrays; public class Main { public s…… 题解列表 2024年09月14日 0 点赞 0 评论 521 浏览 评分:9.0
[LETTERS] BFS 配合 map容器 ##unordered_map的.count函数-用于查找是否出现过该状态,是返回1;```cpp#include#defineULLunsignedlonglong#defineLLlonglong#definePIIpairusingnamespacestd;constintN=1e7+10, 题解列表 2024年09月14日 0 点赞 1 评论 615 浏览 评分:9.9
对题2838:数组之间的转换以及冒泡排序的初步使用 解题思路:本题是要求判断元素为n的数组中,相邻元素的差的绝对值是否可以排列成1~n-1的有序数组,要求该有序数组连续。首先,应当建立一个较大的整型数组来包含输入的数组。其次,可以将数组之间两相邻元素求差的绝对值,覆盖两元素中前一个元素,并将最后一个元素设置为0,便的到了绝对值数组。 题解列表 2024年09月14日 0 点赞 0 评论 621 浏览 评分:9.9
筛素数最全模板 ###暴力筛素数(O(sqrt(n)))#include#includeusingnamespacestd;boolprimes(intx){if(x==2)returntrue;for(inti=2;i 题解列表 2024年09月14日 1 点赞 0 评论 573 浏览 评分:9.9 数字的处理与判断(字符串函数解法) 解题思路:利用字符串来存储数字,用strlen()函数得到数字长度;利用for循环将字符串从左到右遍历输出(空格);利用for循环将字符串从右到左遍历输出;注意事项:1、在开头添加库函数#include;2、每次输出都要换行;3、注意输入输出格式。 题解列表 2024年09月14日 0 点赞 0 评论 412 浏览 评分:0.0 单调栈(可做模板) ##优化版(O(n))###手写栈版#include#includeusingnamespacestd;constintN=5000;inta[N],tt;intmain(void){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);intn;cin 题解列表 2024年09月14日 1 点赞 0 评论 589 浏览 评分:9.9 [编程入门]成绩评定(Switch语句) 摘要:解题思路:利用Switch语句解题,输出语句。注意事项:注意Switch语句格式,最后可以使用default,不要忘记break。参考代码:#include<stdio.h>int main(){ i…… 题解列表 2024年09月14日 7 点赞 0 评论 1475 浏览 评分:6.0 编写题解 1007: [编程入门]分段函数求值 摘要:解题思路:if语句确定x的取值范围,计算输出y。注意事项:注意x的取值范围。参考代码:#include<stdio.h> int main(){ int x,y; scanf("%d…… 题解列表 2024年09月14日 5 点赞 0 评论 1693 浏览 评分:0.0 « 12...399400401402403404405...59115912 »
数字的处理与判断(字符串函数解法) 解题思路:利用字符串来存储数字,用strlen()函数得到数字长度;利用for循环将字符串从左到右遍历输出(空格);利用for循环将字符串从右到左遍历输出;注意事项:1、在开头添加库函数#include;2、每次输出都要换行;3、注意输入输出格式。 题解列表 2024年09月14日 0 点赞 0 评论 412 浏览 评分:0.0
单调栈(可做模板) ##优化版(O(n))###手写栈版#include#includeusingnamespacestd;constintN=5000;inta[N],tt;intmain(void){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);intn;cin 题解列表 2024年09月14日 1 点赞 0 评论 589 浏览 评分:9.9
[编程入门]成绩评定(Switch语句) 摘要:解题思路:利用Switch语句解题,输出语句。注意事项:注意Switch语句格式,最后可以使用default,不要忘记break。参考代码:#include<stdio.h>int main(){ i…… 题解列表 2024年09月14日 7 点赞 0 评论 1475 浏览 评分:6.0
编写题解 1007: [编程入门]分段函数求值 摘要:解题思路:if语句确定x的取值范围,计算输出y。注意事项:注意x的取值范围。参考代码:#include<stdio.h> int main(){ int x,y; scanf("%d…… 题解列表 2024年09月14日 5 点赞 0 评论 1693 浏览 评分:0.0