当前位置:网站首页>2021 RoboCom 世界机器人开发者大赛-高职组初赛
2021 RoboCom 世界机器人开发者大赛-高职组初赛
2022-07-01 22:54:00 【Alan_Lowe】
2021 RoboCom 世界机器人开发者大赛-高职组初赛
文章目录
前言
比赛的时候老师总是说,你们连高职都打不过。
题目都很简单,就直接贴一下代码吧,有的用C++写的,有的用Python写的。
1.机器人打招呼

AC代码
print("ni ye lai can jia RoboCom a?")
2.人脸识别

AC代码
#include<bits/stdc++.h>
using namespace std;
signed main(){
int A,B,C,D,a,b,c;
cin>>A>>B>>C>>D>>a>>b>>c;
cout<<"Diff = "<<A-a<<", "<<B-b<<", "<<C-c<<"\n";
if (abs(A-a) + abs(B-b) + abs(C-c) <= D)
cout<<"Yes";
else
cout<<"No";
return 0;
}
3.月份输出

AC代码
#include<bits/stdc++.h>
using namespace std;
int n;
string s[13] = {
"","January","February","March","April","May","June",
"July","August","September","October","November","December"};
signed main(){
while (cin>>n){
if (n > 12 || n < 1)
break;
cout<<s[n]<<"\n";
}
cout<<"?";
return 0;
}
4.字母串

AC代码
#include<bits/stdc++.h>
using namespace std;
signed main(){
int n;cin>>n;
while(n--){
string s;cin>>s;bool f = true;
for (int i = 0; i < s.length() - 1; ++i) {
if (islower(s[i])){
if (!(s[i + 1] == s[i] - 1 || toupper(s[i]) == s[i + 1])){
f = false;break;
}
}
else
if (!(tolower(s[i]) == s[i + 1] || s[i + 1] == s[i] + 1)){
f = false;break;
}
}
if (f)
cout<<"Y\n";
else
cout<<"N\n";
}
return 0;
}
5.增一数

AC代码
#include<bits/stdc++.h>
using namespace std;
#define int long long
bool check(int x){
int k = 0,kk = x;
while (kk){
kk /= 10; k += 1;
}
if (k % 2 != 0)
return false;
k = pow(10,k / 2);
if (x % k - 1 == x / k)
return true;
return false;
}
signed main(){
int n;cin>>n;
while(n--){
int m,k = 0;
cin>>m;
if (check(m)){
k += 1;
if (ceil(sqrt(m)) * ceil(sqrt(m)) == m)
k += 1;
}
cout<<k<<"\n";
}
return 0;
}
6.答题卡
新浪微博上有网友发文称:“朋友买了本玻尔X海森堡的物理大佬同人本,送了300道高数题。更绝的是,要做完题目按照答案涂答题卡,涂出一个二维码,扫描二维码才能看到特典,做错了就看不到了……”那张传说中的答题卡如下图所示:若答案为 4 位整数(位数不足时在前面补足 0),则前两位为横坐标,后两位为纵坐标。若一题有两小问,则第一问答案为横坐标,第二问答案为纵坐标。若答案为分数,则分子为横坐标,分母为纵坐标。
本题就请你根据答案帮助读者填写答题卡。

AC代码
ch = [['.'] * 105 for i in range(105)]
n, m = map(int,input().split())
for i in range(m):
s = input()
if s.count(';'):
a, b = map(int,s.split(';'))
col = a
row = n - b + 1
ch[row][col] = '#'
elif s.count('/'):
a, b = map(int,s.split('/'))
col = a
row = n - b + 1
ch[row][col] = '#'
else:
a = int(s)
b = a % 100
a //= 100
col = a
row = n - b + 1
ch[row][col] = '#'
for i in range(1,n + 1):
for j in range(1,n + 1):
print(ch[i][j],end='')
print()
7.救救倒霉鬼

AC代码
s = set()
n = int(input())
for i in range(n):
s.add(input())
m = int(input())
for i in range(m):
s.remove(input())
s = list(s)
s.sort(reverse=True)
for i in s:
print(i)
边栏推荐
- Which securities company is better and which is safer to open a securities account
- Convergence and disposal suggestions of some Internet exposure surfaces
- 建模和影视后期有什么关联?
- 每日三题 6.30(2)
- Zero foundation tutorial of Internet of things development
- Programming English vocabulary notebook
- Zhongang Mining: it has inherent advantages to develop the characteristic chemical industry dominated by fluorine chemical industry
- 神经网络物联网的未来趋势与发展
- Huisheng Huiying 2022 intelligent, fast and simple video editing software
- Zhao Fuquan: to ensure supply in the short term, we should build a safe, efficient and resilient supply chain in the long term
猜你喜欢

AirServer最新Win64位个人版投屏软件

Win 10 mstsc connect RemoteApp

Stm32f030f4 drives tim1637 nixie tube chip

SWT / anr problem - SWT causes kernel fuse deadlock
![[kotlin third party] coil koltin collaboration picture loading library coil glide like picture loading third party](/img/ad/dcb993c3e1e79d2c3663f031dfd1b3.png)
[kotlin third party] coil koltin collaboration picture loading library coil glide like picture loading third party

You probably haven't noticed the very important testing strategy in your work

Redis数据类型和应用场景

Airserver latest win64 bit personal screen projection software

Istio、eBPF 和 RSocket Broker:深入研究服务网格

CKS CKA ckad change terminal to remote desktop
随机推荐
日本购物网站的网络乞丐功能
Timer和ScheduledThreadPoolExecutor的区别
2022安全员-C证考试题模拟考试题库及模拟考试
SWT/ANR问题--SWT 导致 low memory killer(LMK)
Convergence and disposal suggestions of some Internet exposure surfaces
Leetcode(34)——在排序数组中查找元素的第一个和最后一个位置
Airserver latest win64 bit personal screen projection software
2022年危险化学品经营单位安全管理人员考试题及在线模拟考试
攻防演习防御体系构建之第三篇之建立实战化的安全体系
物联网现状及未来发展趋势
CKS CKA ckad change terminal to remote desktop
Win 10 mstsc connect RemoteApp
2022年R1快开门式压力容器操作考题及答案
每日三题 6.28
[MySQL] index creation, viewing and deletion
Who do you want to know when opening a stock account? Is it safe to open an account online?
CKS CKA CKAD 将终端更改为远程桌面
Huisheng Huiying 2022 intelligent, fast and simple video editing software
数字峰会人气火爆,城链科技引发新一轮商业变革
【Swoole系列1】在Swoole的世界中,你将学习到什么?