猫史档案馆


SCS_user_EHQ0z2l6el

SCS_user_EHQ0z2l6el

Lv.1

获赞:26收藏:6浏览:351作品收藏:4

签名:清理黑历史

回复帖子评论
上一页5 页 / 共 7下一页

【Python作品分享】排序函数【教程贴】 中回复

这应该是另一种形式的选择排序

2023-05-14T10:29:23 点赞:0

要想当新数等于123的时候,程序结束,但是一直都是重复执行运算,不能停止脚本 中回复

先问一下,你这个算法是想要做什么

2023-05-14T10:35:56 点赞:0

要想当新数等于123的时候,程序结束,但是一直都是重复执行运算,不能停止脚本 中回复

center_image

2023-05-14T10:55:51 点赞:1

为什么kitten编辑器的函数不能递归? 中回复

你这……喵循环了

2023-05-14T10:58:04 点赞:1

首页什么时候刷啊... 中回复

发求助干嘛)

2023-05-14T10:59:35 点赞:0

help me! 不会做联机! 中回复

云列表是个好东西

2023-05-14T11:00:09 点赞:1

有没有听术力口的!!! 中回复

在猫站遇到ppy民简直比出门被拉面创死的几率低

2023-05-26T23:10:05 点赞:0

【Python作品分享】分形樱花树【教程贴】 中回复

这种艺术上的美,不及代码的美

2023-05-26T23:13:06 点赞:0

【内测岛三新模型编辑器VOXA】家人们,谁懂啊!新编辑器竟然这么好用 中回复

大佬发帖了!!!!

2023-05-27T20:02:59 点赞:1

部落冲突·mini 中回复

center_imagecenter_imagecenter_image

2023-06-03T21:50:13 点赞:0

部落冲突·mini 中回复

这是小白带我的第一个地图(

center_image

差了二十万个地图之多)

可见白之懒惰(bushi

2023-06-03T22:03:31 点赞:0

部落冲突·mini 中回复

白呢

2023-06-04T11:14:48 点赞:0

部落冲突·mini 中回复

审核好快!!!!!

https://box3.codemao.cn/p/clash-of-clans

2023-06-04T11:21:22 点赞:0

部落冲突·mini 中回复

v2过力

2023-06-04T17:07:27 点赞:0

部落冲突·mini 中回复

2023-06-08T20:22:29 点赞:0

我到潜力新星啦! 中回复

加油

但是不要太过了以至于发帖(

2023-07-02T17:59:01 点赞:0

计数排序(c++教学) 中回复

#include<iostream>
using namespace std;
const int MAXN=10001;
int a[MAXN],n;
int f[MAXN];
void counting(){
    for(int i=0;i<n;i++){
        f[a[i]]++;
    }
    for(int i=0;i<MAXN;i++)
        for(int j=0;j<f[i];j++)
            cout<<i;
}
int main(){
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    counting();
    return 0;
}

2023-08-01T11:37:29 点赞:0

计数排序(c++教学) 中回复

回顾:

插入、选择排序:https://shequ.codemao.cn/community/538893

冒泡排序:https://shequ.codemao.cn/community/538831

整数的表示:https://shequ.codemao.cn/community/537861

数据的结构与算法概念、算法复杂度:https://shequ.codemao.cn/community/537721

中缀转后缀思路:https://shequ.codemao.cn/community/537172

 后缀表达式+后缀表达式求值思路:https://shequ.codemao.cn/community/537153

2023-08-02T20:38:40 点赞:0

给大家看看我前五名喜欢的枇杷油角色 中回复

bcm啥圈子都有啊)

2023-08-02T20:56:02 点赞:0

求最大公约数C算法实现 中回复

其实求最大公因数的算法还可以再优化一下

辗转相除法缺点就是取模运算耗时长

可以试试更相减损法与移位结合

时间复杂度为O(log(max(a,b)))

比辗转相除法快,究其原因是:避免了取模运算

#include<bits/stdc++.h>
using namespace std;
int gcd(int a,int b){
	if(a==b)return a;
	if((a&1)==0&&(b&1)==0){
		return gcd(a>>1,b>>1)<<1;
	}
	else if((a&1)==0&&(b&1)!=0){
		return gcd(a>>1,b);
	}
	else if((a&1)!=0&&(b&1)==0){
		return gcd(a,b>>1);
	}
	else{
		int b=max(a,b);
		int s=min(a,b);
		return gcd(b-s,s);
	}
}
int main(){
	cout<<gcd(74,111)<<endl;
	cout<<gcd(114,514)<<endl;
	cout<<gcd(314,628)<<endl;
	cout<<gcd(81,123)<<endl;
    return 0;
}

2023-08-05T19:25:03 点赞:0

请问我怎样才能当吉吉喵? 编程猫_拒绝编程猫_求帮助 中回复

逆天

2023-08-17T15:33:01 点赞:2

WTF((( 中回复

喵还有别的意思……你最好别知道

2023-08-20T20:25:26 点赞:1

【神岛百大创作者绝密档案第十二期】擅长唱跳code和美术的一只@可乐OωO! 中回复

这帖子回来了!!!???

2023-08-20T20:43:30 点赞:0

【Kitten N公测开始】我来啦我来啦!我带着三端合一走来啦! 中回复

官帖回来了!!!

2023-08-20T20:44:43 点赞:2

盗的就是你! 中回复

6.

2023-08-22T15:04:21 点赞:0

【神岛JS萌新教程】BoxJS 从入门到实战 第十四期——神奇的选择器! 中回复

\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/\可乐/

2023-08-29T09:04:38 点赞:0

【神奇代码岛】对乐大王组织的看法 中回复

不做评价,我当个旁观者

2023-08-29T10:24:52 点赞:0

BOX2:喵仗中心更新啦! 中回复

6.

2023-08-29T11:07:05 点赞:0

怎么用c++整人 中回复

#include <iostream>
#include<queue>
#include<vector>
using namespace std;
int a[1005][1005];
int vis[1005][1005];
int dis[1005][1005];///维护到出发点的最短距离
const int MAXN=4;
int fx[MAXN] = {1,-1,0,0};
int fy[MAXN] = {0,0,-1,1};
struct node{
    int x, y;
};
int main(){
    int n;
    cin >> n;
    memset(a,-1,sizeof a);
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            cin >> a[i][j];
        }
    }
    ///bfs
    queue <node> q;
    node z;
    z.x=1;z.y=1;
    q.push(z);///压入起点
    vis[1][1] = 1;

    while(!q.empty()){
        node now = q.front();
        q.pop();

        ///访问我下一步能够到达的结点
        for(int i = 0; i < MAXN; i++){
            int tox = now.x + fx[i];
            int toy = now.y + fy[i];
            if(vis[tox][toy] == 0 && a[tox][toy] == 0){
                z.x=tox;z.y=toy;
                q.push(z);
                vis[tox][toy] = 1;
                dis[tox][toy] = dis[now.x][now.y] + 1;
            }
        }
    }
    cout << dis[n][n]+1;
}//不如写个bfs让他们伤心、难过、自尊心没了

2023-08-29T17:33:00 点赞:0

怎么用c++整人 中回复

你第四个代码那个y是等待吧,那你为啥不用Sleep?

2023-08-29T17:36:09 点赞:0