这名用户暂未设置签名。
追踪最近的用户名外显变动记录。
最近的文章、讨论、云剪贴板与社区记录
在讨论《大家帮忙看看为什么不用memset了还是答案错误》回复:
@[天汉CbIH](/user/295862) 改成这样也还是错啊,帮帮忙改改呗 ``` int ch = str[k] - '0'; ```
``` //这题只要判断出这个字符串是否存在即可 #include #include using namespace std; const int N = 1e5 + 10; const int M = 3*1e6+10; int cnt[M]; int trie[M][60], tot = 1;//初始化 char…
``` cpp #include #define ll long long using namespace std; const int N =10100; ll int maxn=0; ll int t; struct ty { int x,y; int sum; }a[N]; bool cmp(ty a,ty b)…
大佬们帮忙看看,dis的值为什么会改变 只查询,没更改任何操作,dis的值却变化了。这是为什么啊,大佬们求求了 ``` 测试异常结果 6 M 1 6 1 0 0 0 0 0 C 1 1 1 0 0 0 0 0 M 2 4 1 1 0 0 0 0 M 2 6 1 1 0 2 0 0 C 3 0 1 1 0 2 0 0 /…
``` cpp #include #include #include #include #define ll long long using namespace std; const int N=1000010; ll a[N],ans,maxn,n,c,k,sum,d,j; ll day[N],l,r; //std:…
``` cpp #include using namespace std; const int N=1e6+10; //int d[N],s[N],t[N]; int n,m,a[N],s[N];//s[i]来维护差分数组 struct ty{ int d,s,t; }b[N]; bool judge(int x,in…
``` cpp #include using namespace std; #define ll long long const int N=1e5+10; int n,m,ans; struct ty { int pos;//下标 int ans;//数量 }a[N]; int binary_search(ty a[…
在讨论《为什么模板都能错,呜呜呜》回复:
@[sgweo8ys](/user/203501) 好的,谢谢
在讨论《为什么模板都能错,呜呜呜》回复:
@[ZiShan_](/user/643561) 麻烦帮我看看如果我用双端闭区间二分哪个细节出了问题,谢谢
在讨论《为什么模板都能错,呜呜呜》回复:
@[ZiShan_](/user/643561) 还是错的
``` cpp #include using namespace std; #define ll long long const int N=1e6+10; int a[N]; int n,m,ans; int main() { cin>>n>>m; for(int i=1;i >a[i]; while(m--) {…
``` cpp #include using namespace std; int n,m,c[610]; bool flag; int tmp; struct ty{ int t;//t存放这条边和哪条边连接 int next; //next存放下一个点的下标是谁 }edge[100010]; int head[10…
在讨论《为什么用了快读还是90分》回复:
@[yyandy](/user/234101) @[Surelysuper](/user/234114) 嗯嗯,我刚刚把5万看成5000了,谢谢
``` cpp //种类并查集 //种类并查集求的并非具体种类,而是关系! #include using namespace std; const int N=100010; int n,m,a,b,c,ans=0,cnt=0; int fa[N]; map mp; inline int read() { char c…
``` cpp #include using namespace std; const int N=10010; int n,m,a,b,c,ans=0,cnt=0; int fa[N]; map mp; int find(int x)//找x的根节点 { if(x == fa[x]) return x; else r…
在讨论《大家帮忙看看DFS的细节哪里没考虑到》回复:
那如果这样写为什么就不对了呢 就是把标记数组都放在循环里面 ``` for(int i=0;i =1&&xx<=n&&!vis[xx]) { //防止越界同时防止重复 vis[x]=1; dis[xx]=dis[x]+1; dfs(xx);//下一个,继续 vis[x]=0;//记得清标记 } } ```
在讨论《大家帮忙看看DFS的细节哪里没考虑到》回复:
@[天南星魔芋](/user/399239) 我刚刚在CSDN上看了看,没找到好文章,能不能帮忙推个文,我自己看看吧,麻烦了
在讨论《大家帮忙看看DFS的细节哪里没考虑到》回复:
@[天南星魔芋](/user/399239) 这跟马的遍历的那个广搜一样要判重对吧,但是能不能请教下这个判重的原理是什么,谢谢
``` cpp #include using namespace std; const int N=210; int n,x,y,a[N]; //这道题的方向数组是不定的 int vis[N],dis[N]; int dfs(int x) { // vis[x]=1; if(x == y) return dis[x];…
在讨论《大家帮忙看看BFS的哪一步错了》回复:
@[天南星魔芋](/user/399239) 不知道咋判重,我加了行 ``` cout<<temp<<" "<<xx<<" "<<yy<<" "<<endl; 结果是这样: 3 3 1 1 4 1 1 0 4 1 1 11 3 2 9 3 0 6 2 0 8 2 2 5 1 2 3 4 1 1 1989120 4 1…
在讨论《大家帮忙看看BFS的哪一步错了》回复:
@[天南星魔芋](/user/399239) 判重了啊,用vis数组来标记是否走过的啊
``` cpp //本题dfs没错,开的N的范围是错的 #include using namespace std; #define ll long long const int N=1e3+10;//这题题目n的最大值为1e3 ll int t,n,h,r,p; ll int vis[N],con[N][N]; ll…
``` cpp #include using namespace std; const int N=410; int n,m,x,y,ans,temp,tmp; queue q; int vis[N],dis[N]; int dir[8][2]={{2,1},{-2,1},{2,-1},{-2,-1},{1,2},{1…
在讨论《为什么遍历最大值用不能用dp[i][j]》回复:
@[DarksideCoderω](/user/161296) 好的,谢谢
``` cpp #include using namespace std; int m,n,maxn; int a[110][110],dp[110][110]; int dir[4][2]={{1,0},{-1,0},{0,1},{0,-1}}; int dfs(int x,int y)//从1,1开始 //错误点d…
在讨论《兄弟们帮忙看看为什么样例都对的,结果交上去一个都没过》回复:
@[gujiga](/user/327969) 好的,已经过了,谢谢
``` cpp #include #define ll long long using namespace std; const int N=1e4+10; ll int m,n,x,y;//last记录和上一个数是谁 //int dp[510]={1}; //错误点1:这样定义数组,除了第一个数是1,后面都是0 ll…
在讨论《为什么开了long long 还是测试点1和5还是不对啊,大家帮忙看看》回复:
@[一个pupil](/user/500205) 好的,已经过了,谢谢
``` cpp #include //因为这个题目的卒是在格子的交点上走的,所以从(0,0)到(1,1) //实际上是走过了一个2*2的格子 #define ll long long using namespace std; ll int m,n,x,y; ll int dp[30][30],a[30][30]; in…
在讨论《大佬们帮忙看看为什么陷入了死循环,一直没找出来》回复:
@[caihaolang](/user/363036) 谢谢大佬,一直没找出来错误