自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 机器人

机器人一.题目描述算法分析代码 一.题目描述 蒜头君收到了一份礼物,是一个最新版的机器人。这个机器人有 444 种指令: forward x,前进x 米。 back x,先向后转,然后前进 x 米。 left x,先向左转,然后前进 x 米。 right x,先向右转,然后前进x 米。 现在把机器人放在坐标轴原点,起始朝向为 x 轴正方向。经过一系列指令以后,你能告诉蒜头君机器人的坐标位置吗。坐标轴上一个单位长度表示 1米。 输入格式: 第一行输入一个整数 n(1≤n≤100 表示指令的个数。 接下里 n

2020-09-26 19:55:02 521

原创 {A} + {B}(set)

#include <iostream> #include<set> using namespace std; int main() { int n,m,x; set<int>s1; while(cin>>n>>m) { for(int i=0;i<n;i++) { ...

2019-07-18 10:52:49 135

原创 Dungeon Master bfs

题目链接 #include <iostream> #include <string> #include <cstring> #include <queue> using namespace std; struct node//用结构体构造 { int x,y,z; int count; }; int l,r,c,i,j,k; char...

2019-07-17 20:58:09 119

原创 强盗(并查集)

题意: 第一行n,m,n为强盗人数,m为警方收集的m条线索 接下来m行,每行一个线索, n m a b a b …表示a,b为同伙. 求一共几个团伙 #include<iostream> using namespace std; int f[1000]={0}; int n,m,sum,a,b; void init(int n) { for(int i=1;i<=n;i+...

2019-07-17 15:13:10 227

原创 A - Trip For Meal

A. Trip For Meal time limit per test1 second memory limit per test512 megabytes inputstandard input outputstandard output Winnie-the-Pooh likes honey very much! That is why he decided to visit his fri...

2019-07-16 10:08:19 204

原创 B - Weird Rounding

题目链接 题意:给一个数,和一个k,要你删除数里面的某些数字使得这个数能被k整除,求最少删除多少个数? 1.0的个数小于k,删除所有位只剩一个0 2.0的个数大于等于k,从后向前直到后面的0的个数等于k #include <iostream> using namespace std; string s; int k; int main() { cin >> s &g...

2019-07-15 16:29:27 147

原创 汉诺塔问题 递归思想

#include<stdio.h> //递归写一个思路,不需要具体 void movee(int n,int x,int y,int z) { if(n==1) printf("%c-->%c\n",x,z); else { movee(n-1,x,z,y);//将n-1个盘子利用z移动到y上 printf(...

2019-05-21 21:00:10 190

原创 华为oj24点

题目描述 问题描述:给出4个1-10的数字,通过加减乘除,得到数字为24就算胜利 输入: 4个1-10的数字。[数字允许重复,测试用例保证无异常数字] 输出: true or false 输入描述: 输入4个int整数 输出描述: 返回能否得到24点,能输出true,不能输出false 输入例子: 7 2 1 10 输出例子: true 解答代码: #include<iostream>...

2019-05-19 18:02:11 219

空空如也

空空如也

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

TA关注的人

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