自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 问答 (5)
  • 收藏
  • 关注

原创 anti_Nim game(反NIM游戏)

anti_Nim game(反NIM游戏)

2022-07-10 21:10:39 678 1

原创 数组,整型,字符变量在全局和局部的存在形式

代码很清楚,直接上代码

2022-06-10 15:23:04 167

原创 字符类型回文序列判断方法,寻找多个子字符串中的回文序列

1, 回文序列判断#include<iostream>#include<bits/stdc++.h>using namespace std;string reverse(string str){ int n = str.length(); for(int i=0;i<n/2;i++) { swap(str[i],str[n-i-1]); } return str;}bool isPalindrome(string a){

2022-04-30 00:00:00 411

原创 int转string与string转int

1,int转string:c++11#include<iostream>using namespace std;int main(){ int n;cin>>n;string s;s=to_string(n);//核心cout<<n<<s;return 0;}2,string转int#include<iostream>using namespace std;int main(){string::size_

2022-04-16 16:04:12 567

原创 A.ABC String

A.ABC String**problem**Code and AnalysisproblemChinese LanguageThis is just a translation of the main meaningExampleinput4AABBACCACABBBBACABCAoutputYESYESNONONoteIn the first testcase one of the possible strings b is “(())()”.In the se

2022-03-31 20:38:47 126

原创 The full sequence of characters

Here only 26 English letters are arranged in all orders.Code is as follows//Recursion on ABCD....#include<iostream>using namespace std;const int N = 10000;char box[N];int vis[N];int aim;void recursion(int n){ if(n>aim) { for(int i

2022-03-30 22:16:40 77

原创 char tips

#include<iostream>using namespace std;const int N=1000;char a[N]; int main(){ printf("input\n"); scanf("%s",(a+1)); //Directly use the char type as a string //and at the same time, I added one to the first address //In addition, the addr.

2022-03-30 19:25:39 61

原创 A. Split it

inputCopy75 1qwqwq2 1ab3 1ioi4 2icpc22 0dokidokiliteratureclub19 8imteamshanghaialice6 3aaaaaaoutputCopyYESNOYESNOYESNONONoteIn the first test case, one possible solution is a1=qwa1=qw and a2=qa2=q.In the ...

2022-03-28 22:29:15 107

原创 高精度加高精度乘的算法实现(c++)

在这里说一下,高精度的问题实质上是将一个非常大的数,按照个,十,百,千,万...,每一位上的数分别对应存到数组里从而将这个数通过for循环等输出出来。以求阶乘之和为例https://www.luogu.com.cn/problem/P1009我的代码#include<iostream>using namespace std;long long a[110],q,site,s[110];void high_precision_multiplication(long lon

2022-03-19 13:05:14 945

原创 面对同时含有字符和数字的输入该如何简便处理

比如输入以下数据:2000/03/02那么问题来了,只将2000,03,02,这三个整形的数字分别赋值给a,b,c呢?(直接好看代码吧!)#include<iostream>using namespace std;int main(){int a,b,c; scanf("%d/%d/%d",&a,&b,&c);printf("%d %d %d",a,b,c);return 0;}...

2022-03-08 17:14:39 152

原创 P4779 【模板】单源最短路径(标准版)(dijkstra)

题目背景2018 年 7 月 19 日,某位同学在NOI Day 1 T1 归程一题里非常熟练地使用了一个广为人知的算法求最短路。然后呢?100 \rightarrow 60100→60;\text{Ag} \rightarrow \text{Cu}Ag→Cu;最终,他因此没能与理想的大学达成契约。小 F 衷心祝愿大家不再重蹈覆辙。题目描述给定一个 nn 个点,mm 条有向边的带非负权图,请你计算从 ss 出发,到每个点的距离。数据保证你能从 ss 出发到任意点。..

2022-03-04 12:22:42 404

原创 Questions about vector

1,一维数组,从对为输入后的下标问题;#include<iostream>#include<vector>using namespace std;int main(){ vector<int> a; for(int i=1,x;i<=3;i++) { cin>>x; a.push_back(x); } cout<<a[0]<<" "<<a[1]<<" "<&

2022-02-28 16:11:04 57

原创 P1596 [USACO10OCT]Lake Counting S(以较为简短的代码,较为通俗的理解)

本题链接:https://www.luogu.com.cn/problem/P1596​​​​​​​d当然蒟蒻用的也是bfs;直接上代码#include<iostream>using namespace std;#define maxx 103int n,m,ans=0;char a[maxx][maxx];int posi1[]={0,0,1,-1,1,-1,-1,0,1};int posi2[]={0,1,1,1,0,0,-1,-1,-1};(8个方向)vo.

2022-02-22 21:30:05 197

原创 dfs的顺序问题发现

切记截至条件一定要放到上边或者说一定要注意dfs的顺序问题;不同的顺序有可能导致不同的结果例如这一题;题目背景知らないことばかりなにもかもが(どうしたらいいの?)一切的一切 尽是充满了未知数(该如何是好)それでも期待で足が軽いよ(ジャンプだ!)但我仍因满怀期待而步伐轻盈(起跳吧!)温度差なんていつか消しちゃえってね冷若冰霜的态度 有朝一日将会消失得无影无踪元気だよ元気をだしていくよ拿出活力 打起精神向前迈进吧我们Aqours,要第一次举办演唱会啦!虽然.

2022-02-21 17:38:39 133

原创 洛谷测试数据无法打开

在我的电脑上出现了将测试点下载后用notepad打开后什么都没有如图刚把测试点下载完是这个样子可以把".out"的后缀名也改为".in"像这样接下来不要直接打开,按如下方式打开鼠标右键点击找到打开方式用notepad(也就是记事本了)打开即可;以上只是自己摸索出来的办法,至于进一步的原理,我也不是很清楚,如果有哪位大神之知道原理的话,或者有更好的处理方式的话,望分享帮助你我他。...

2022-02-20 17:42:23 3500 2

原创 A - Pairs Forming LCM

Find the result of the following code:long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) for( int j = i; j <= n; j++ ) if( lcm(i, j) == n ) res++; // lcm means least common multiple r.

2022-02-07 20:51:00 190

原创 #define 优化时间复杂度;

#define ll long long //意思是用ll代替long long#define MAXN 199//意思是用MAXN代替199;通过观察可以发现define的模板格式如下#define (代替变量的符号) (要被代替的变量);

2022-02-02 14:03:53 1248

原创 算法竞赛常见错误总结(以下内容主要目的供自己学习,如果可以帮助他人乐意之至)(会不定期更新哦)

1,数据范围,如:应该用long long的,却用成int;常常导致——wrong

2022-01-21 15:12:47 257

原创 递归:典型阶乘之和;

典型阶乘n!之和;#include<bits/stdc++.h>using namespace std;int n;int f(int x){ return !x?1:x*f(x-1);}int main() { int sum=0;scanf("%d",&n);for(int i=n;i>0;i--){ sum+=f(i);}printf("%d\n",sum);return 0;}基本思想:1递归2for循环;...

2022-01-11 18:58:19 127

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除