当前位置:网站首页>2021 robocom world robot developer competition - semi finals of higher vocational group
2021 robocom world robot developer competition - semi finals of higher vocational group
2022-07-01 23:32:00 【Alan_ Lowe】
2021 RoboCom World robot developer competition - Semi finals of higher vocational group
List of articles
Preface
During the competition, the teacher always said , You can't even compete in Higher Vocational Education .
The questions are simple , Just post the code directly .
1. AI says hello

AC Code
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n;
set<string> s;
signed main(){
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>n;
while (n--){
string ss;
cin>>ss;
if (s.count(ss))
cout<<"Hi "<<ss<<"! Glad to see you again!\n";
else
cout<<"Hello "<<ss<<", how are you?\n",s.insert(ss);
}
return 0;
}
2. AI digital translation

AC Code
#include<bits/stdc++.h>
using namespace std;
#define int long long
string a;int d;
signed main(){
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>a>>d;
if (d == 10){
string s = "";
int k = 1,num = 0;
for (int i = a.length() - 1; i >= 0; --i) {
num += k * (a[i] - '0');
k *= 10;
}
if (num == 0){
cout<<"0";
return 0;
}
while (num){
if (num % 27 < 10)
s.insert(s.begin(),'0' + num % 27);
else
s.insert(s.begin(),num % 27 - 10 + 'A');
num /= 27;
}
cout<<s;
}
else{
int k = 1,num = 0;
for (int i = a.length() - 1; i >= 0; --i) {
if (a[i] <= '9')
num += k * (a[i] - '0');
else
num += k * (a[i] - 'A' + 10);
k *= 27;
}
cout<<num;
}
return 0;
}
3. Robot puzzle

AC Code
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,m;
int note[105][105];
signed main(){
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>n>>m;
for (int i = 1; i <= n * m; ++i) {
string s;cin>>s;
int x = 1,y = 1;
for (int j = 0; j < s.length(); ++j) {
switch (s[j]) {
case '1':
y += 1;y = min(y,m);break;
case '2':
x += 1;x = min(x,n);break;
case '3':
y -= 1;y = max((long long)1,y);break;
case '4':
x -= 1;x = max((long long)1,x);break;
default:
if (!note[x][y])
note[x][y] = i;
break;
}
}
}
for (int i = 1; i <= n; ++i) {
cout<<note[i][1];
for (int j = 2; j <= m; ++j) {
cout<<" "<<note[i][j];
}
cout<<"\n";
}
return 0;
}
4.PAT Basic ranking

AC Code
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define psi pair<string,int>
int n,m;
int score[6] = {
0,30,50,60,80,100};
vector<psi> v[6];
bool cmp(psi a,psi b){
if (a.second == b.second)
return a.first < b.first;
return a.second > b.second;
}
signed main(){
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>n>>m;
for (int i = 0; i < n; ++i) {
string s;int sco;
cin>>s>>sco;
if (sco > 80)
v[5].push_back(psi(s,sco));
else if (sco > 60)
v[4].push_back(psi(s,sco));
else if (sco > 50)
v[3].push_back(psi(s,sco));
else if (sco > 30)
v[2].push_back(psi(s,sco));
else
v[1].push_back(psi(s,sco));
}
for (int i = 1; i <= 5; ++i)
sort(v[i].begin(),v[i].end(),cmp);
for (int i = m; i >= 1; --i) {
int now = 1,now_bl = 0,sum = 0;
for (int j = i; j >= 1; --j)
sum += v[j].size();
for (int j = 0; j < v[i].size(); ++j) {
if (v[i][j].second == 0){
cout<<v[i][j].first<<"\n";
continue;
}
if (j == 0){
cout<<v[i][j].first<<" "<<i<<" "<<v[i][j].second<<"/"<<score[i]<<" "<<now<<"/"<<sum<<"\n";
}
else{
if (v[i][j].second == v[i][j - 1].second){
cout<<v[i][j].first<<" "<<i<<" "<<v[i][j].second<<"/"<<score[i]<<" "<<now<<"/"<<sum<<"\n";
now_bl += 1;
}
else{
now += 1 + now_bl;now_bl = 0;
cout<<v[i][j].first<<" "<<i<<" "<<v[i][j].second<<"/"<<score[i]<<" "<<now<<"/"<<sum<<"\n";
}
}
}
}
return 0;
}
5. AI Criminal Police

AC Code
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,m,a;
vector<int> v;string s;
map<vector<int>,string> mp;
signed main(){
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>n>>m;
for (int i = 0; i < n; ++i) {
v.clear();
for (int j = 0; j < m; ++j) {
cin>>a;v.push_back(a);
}
cin>>s;
mp[v] = s;
}
while (1){
v.clear();
for (int i = 0; i < m; ++i) {
cin>>a;v.push_back(a);
}
if (v[0] == 0)
break;
if (mp[v] == "")
cout<<"Pass\n";
else
cout<<mp[v]<<"\n";
}
return 0;
}
边栏推荐
- 证券开户选哪个证券公司比较好,哪个更安全
- Distance measurement - Hamming distance
- 2022年最佳智能家居开源系统:Alexa、Home Assistant、HomeKit生态系统介绍
- 物联网开发零基础教程
- Similarities and differences between the defined identity execution function authid determiner and PostgreSQL in Oracle
- Leetcode (34) -- find the first and last positions of elements in a sorted array
- mysql binlog的清理
- What is mosaic?
- The third part of the construction of the defense system of offensive and defensive exercises is the establishment of a practical security system
- Matplotlib常用图表
猜你喜欢

2021 RoboCom 世界机器人开发者大赛-高职组初赛

Material Design组件 - 使用BottomSheet展现扩展内容(一)

from pip._internal.cli.main import main ModuleNotFoundError: No module named ‘pip‘

2022年R1快开门式压力容器操作考题及答案

Zhao Fuquan: to ensure supply in the short term, we should build a safe, efficient and resilient supply chain in the long term

PostgreSQL source code (57) why is the performance gap so large in hot update?

Experience of practical learning of Silicon Valley products

2022 R1 fast opening pressure vessel operation test questions and answers

Redis data types and application scenarios

Why is PHP called hypertext preprocessor
随机推荐
【必会】BM41 输出二叉树的右视图【中等+】
2022 crane driver (limited to bridge crane) examination questions and simulation examination
Practical application and extension of plain framework
Oracle中已定义者身份执行函数AUTHID DEFINER与Postgresql行为的异同
Redis AOF log
The digital summit is popular, and city chain technology has triggered a new round of business transformation
What is the relationship between modeling and later film and television?
Notes on problems - /usr/bin/perl is needed by mysql-server-5.1.73-1 glibc23.x86_ sixty-four
mysql binlog的清理
plain framework的实际应用和扩展
ShanDong Multi-University Training #3
openwrt 开启KV漫游
Daily three questions 6.28
Leetcode(34)——在排序数组中查找元素的第一个和最后一个位置
【无标题】
Postgresql随手记(10)动态执行EXECUTING语法解析过程
Commemorate becoming the first dayus200 tripartite demo contributor
Yunxin small class | common cognitive misunderstandings in IM and audio and video
De PIP. Interne. CLI. Main Import main modulenotfounderror: No module named 'PIP'
股票开户哪个证券公司最好,有安全保障吗