- 博客(14)
- 收藏
- 关注
原创 P5322 [BJOI2019]排兵布阵
失踪人口回归{\color{Lavender}失踪人口回归}失踪人口回归目录好康的代码思路。。。好康的代码#include<bits/stdc++.h>using namespace std;int s,n,m;int plan[120][120];//每个玩家的计划,第i个城堡vector<int> place[120];vector<int> value[120];int mark[120][20020];int f(int x,int h){
2021-12-10 22:51:03
545
原创 2021 CSP 赛后反思
文章目录CANDYSORTNETWORKFRUITCANDY普及- 难度。。。数论推一下即可。。。代码:#include<bits/stdc++.h>using namespace std;int main(){ //freopen("candy.in","r",stdin); //freopen("candy.out","w",stdout); int n,l,r; scanf("%d%d%d",&n,&l,&r); int v=l%n; if
2021-10-24 23:24:47
240
原创 P2280 [HNOI2003]激光炸弹
文章目录嗯,错误的代码正确的思路嗯,错误的代码#include<bits/stdc++.h>using namespace std;short a[5010][5010];short b[5010][5010];short c[5010][5010];int main(){ int n,m; cin>>n>>m; int X=0,Y=0; for(int i=1;i<=n;i++){ int x,y,v; scanf("%d%d%d",
2021-10-16 23:10:45
211
原创 P2697 宝石串
文章目录思路代码易错点思路用前缀和预处理,是‘G’就加1,是’R’就减一,再将每个点的值存入一个数组,遍历,找出两个相等值间最大差。代码#include<bits/stdc++.h>using namespace std;int ball[1000010];int record[1000010];int main(){ char c; c=getchar(); int i=0; int h=0; while(c=='G'||c=='R'){ if(c=='G') h
2021-10-16 20:48:53
471
原创 P1572 计算分数
目录思路代码思路读字符串,先定义01\tfrac{0}{1}10,转数字,不断通分,加ororor减,再约分(反正字符长度不超过100对吧,很少,也很快。。),最后在特判一下,分母为1 ororor 负数的情况就好啦代码精炼冗长的代码#include<bits/stdc++.h>using namespace std;string a;int i=0;int f(int x,int y){ if(x==0) return y; else return f(y%x,x);
2021-10-09 22:08:35
142
原创 P2296 [NOIP2014 提高组] 寻找道路
目录分数估分实际分数思路代码一点想法正解错误原因正确思路正确代码分数估分20{\color{Red}20}20实际分数20{\color{Red}20}20思路代码#include<bits/stdc++.h>using namespace std;bool a[10010][10010];int n,m;int be,en;bool find_[10010];int finddp[10010];bool find(int x){ if(finddp[x]!=-1
2021-10-05 11:23:56
175
原创 P1322 logo语言
文章目录代码思路一些注意点注1注2注3注4代码#include<bits/stdc++.h>using namespace std;char logo[300];int len=0;int s=0;void read(){//注1 int c=getchar(); while((c>='A'&&c<='Z')||c==' '||(c>='0'&&c<='9')||c=='['||c==']'){ logo[len]=
2021-10-04 17:09:37
536
1
原创 2021-10-04模拟赛
文章目录 1、a2、b3、c 1、玩具谜题 算法思路:模拟#include<bits/stdc++.h>using namespace std;struct human{ bool face; char name[15];};struct ask_{ bool direct; int step;};ask_ b[100010];int n,m;human a[100010];int main(){ scanf("%d%d",&n,&..
2021-10-04 14:53:39
113
原创 P1469 找筷子
两种解法普通算法"超时空间"算法位运算(这才是正解)原理标程普通算法"超时空间"算法#include<bits/stdc++.h>using namespace std;bool c[120000000];int main(){ int n,o; cin>>n; for(int i=1;i<=n;i++){ a[i]=a[i]^1; } for(int i=1;i<=119999999;i++){ } return 0;}用了一点
2021-10-03 22:45:01
362
原创 P3958 [NOIP2017 提高组] 奶酪
文章目录原问题原代码问题分析正确解法原问题WrongAnswer{\color{Red}Wrong Answer}WrongAnswer原代码#include<bits/stdc++.h>using namespace std;struct zb{ long long x; long long y; long long z;};int T;bool s[1005][1005]; int n,h,r;int u[1005][2];bool walk[1005];bo
2021-10-03 19:35:58
218
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人