上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: https://www.luogu.com.cn/problem/P1716 涉及知识点:模拟,排序橙色题 思路: 我们先对所有的数来一下从大到小排序。定义两个变量,分别在头尾,输出所在位置上的数后互相靠近,直到越过彼此为止。 代码: include <iostream> #include <alg 阅读全文
posted @ 2022-07-07 07:48 -イレイナ 阅读(49) 评论(0) 推荐(0)
摘要: P1628 合并序列[普及-] https://www.luogu.com.cn/problem/P1628涉及知识点:字符串,排序,二叉堆 橙色题 思路: 主要用到的函数为find函数,find函数用来对原始数据中某个字符串进行定位,以确定其位置,返回位置。 判断是否是以字符串T为前缀的单词只需要find返回的数为0即可(因为是 阅读全文
posted @ 2022-07-07 07:38 -イレイナ 阅读(39) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1003涉及知识点:模拟,枚举暴力橙色题 思路:先输出,逆序找,因为后来的地毯会覆盖之前的,一发现有解就输出 代码: #include"cstdio" #include"iostream" using namespace std; 阅读全文
posted @ 2022-07-06 21:21 -イレイナ 阅读(39) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1328 模拟橙色题 代码: #include <bits/stdc++.h> using namespace std; const int MAXN = 200 + 10; int n, na, nb, a[MAXN], b[MA 阅读全文
posted @ 2022-07-06 21:17 -イレイナ 阅读(98) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1308涉及知识点:模拟,字符串橙色题 思路?在代码里 #include<bits/stdc++.h> using namespace std; string word,sen; int ans,j,ans1; int main() 阅读全文
posted @ 2022-07-06 13:47 -イレイナ 阅读(157) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1012涉及知识点:字符串,排序橙色题 代码: #include<iostream> #include<string> #include<algorithm>//提供sort using namespace std; string 阅读全文
posted @ 2022-07-06 13:25 -イレイナ 阅读(62) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P4419涉及知识点:模拟橙色题 思路: 1.先预处理: a[12]={0,4,4,4,4,4,4,4,4,4,16,4}; 1~11 其中10有16张,其余的只有4张 2.求出x也就是差值,如果最后x小于1那么直接输出"DOSTA" 阅读全文
posted @ 2022-07-06 10:16 -イレイナ 阅读(60) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1755涉及知识点:模拟,数学橙色题 思路: 一.先把斐波那契数列的前45项求出来 二.斐波那契数列求出来了后,进行一个贪心(当前最大可选那个),从后面大的数据开始算(原题:若有多组数据,以个数最小的为准,若仍有多组,输出右边尽量大 阅读全文
posted @ 2022-07-06 08:00 -イレイナ 阅读(203) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1862涉及知识点:枚举暴力,模拟,排序橙色题 思路: 设东西向主管道的 yy 坐标是 mm ,则输油管道总长 S=|y1-m|+|y2-m|+...+|yn-m|, 题中的x坐标根本无用,因为管道必须从左到右连在一起,x是行一.将 阅读全文
posted @ 2022-07-05 21:52 -イレイナ 阅读(82) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1808涉及知识点:字符串,排序 橙色题 思路: 一.读入n和n个字符串 二.边读入字符串边将这个字符串内部从小到大排序 三.再将这n个字符串从小到大进行排序 四.因为这n个字符串从小到大排序,全部组成这个字符串的字母的数量相等的字 阅读全文
posted @ 2022-07-05 18:49 -イレイナ 阅读(44) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 下一页