sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo chmod 777 /etc/apt/sources.list
sudo vim /etc/apt/sources.list
gg d G # 删除首行到尾行内容快捷键
sudo apt install curl gnupg2
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
!!! 若在此步骤出现以下错误:
curl:(7)Failed to connect to raw.githubusercontent.com port443:Connection refused
表面你的访问被墙了或者DNS域名解析被污染
解决:
1 访问域名解析工具网页 输入raw.githubusercontent查看对应的IPv4地址
2 新开一个终端,进入到/etc/hosts目录下,输入sudo vim /etc/hosts打开,进入insert模式,插入以下内容:
185.199.110.133 raw.githubusercontent.com
185.199.110.133 user-images.githubusercontent.com
185.199.110.133 avatars2.githubusercontent.com
185.199.110.133 avatars1.githubusercontent.com
保存退出后重试即可解决 若不行 尝试其余三个IP地址
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] https://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
sudo apt upgrade
sudo apt install ros-humble-desktop
source /opt/ros/humble/setup.bash
ros2 run turtlesim turtlesim_node
出现小海龟图片即成功 以后每次进入ros环境均要source一下setup.bash
题意:因子只由2,3,5,7组成的数字为Humble Numbers,问你第n个Humble Numbers是几。 链接:HDU 1058传送门 想法:Humble Numbers都可以写成2的几次方*3的几次方*5的几次方*7的几次方,可以用dp也可以直接打表来模拟,我用的是直接打表,也很快且容易理解 代码: ...
题目:Humble Numbers 题解:这是一个简单dp,就是输出比较麻烦。题目要求的数字是只能整除2、3、5、7的,所以可以对于第i个数,可以从1~i-1依次遍历,每个数都可以乘上2、3、5、7,寻找比第i个数大的最小的。...
Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, … shows the f...
Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, … shows the f...
Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, … shows the f...
题意 A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers...
M - Humble Numbers Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description A number whose...
Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first ...
Humble Numbers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25735 Accepted Submission(s): 11344 P...
课堂学习...