首页 > 其他分享 >2022 RoboCom 世界机器人开发者大赛-高职组(省赛)

2022 RoboCom 世界机器人开发者大赛-高职组(省赛)

时间:2023-07-14 13:34:17浏览次数:27  
标签:cout int nullptr cin long 2022 tie 省赛 RoboCom

RC-v1 您好呀

print("Nin Hao Ya ~")

RC-v2 爷爷奶奶您好呀

#include <bits/stdc++.h>

using namespace std;

#define int long long

int32_t main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    string a , b , c ;
    cin >> a >> b >> c;
    cout << b << " ";
    if( a == "M" ) cout << "YeYe Nin Hao Ya ~";
    else cout << "NaiNai Nin Hao Ya ~";
    return 0;
}

RC-v3 智能监测

时间是假的

#include <bits/stdc++.h>

using namespace std;

#define int long long

int32_t main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    int n , T , p;
    string time;
    cin >> n >> T;
    for( ; n ; n -- ){
        cin >> time >> p;
        if( 80 - T <= p && p <= 80 + T )
            continue;
        cout << time << " " << p << "\n";
    }
    return 0;
}

RC-v4 生成字母串

认真读读题

#include <bits/stdc++.h>

using namespace std;

#define int long long

int32_t main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    int n;
    char a;
    string s;
    cin >> n >> a >> s;

    cout << a;
    for (auto i: s) {
        if (i == '0') {
            if (a >= 'a' && a <= 'z')
                a = a + 'A' - 'a';
            else a = a + 'a' - 'A';
        } else {
            if (a >= 'a' && a <= 'z') {
                if (a != 'a') a--;
                else continue;
            } else {
                if (a != 'Z')a++;
                else continue;
            }
        }
        cout << a;
    }
    return 0;
}

RC-v5 数字宝宝

#include <bits/stdc++.h>

using namespace std;

#define int long long

int32_t main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    int a, b, x = 0, y = 1;
    cin >> a >> b;
    while (a) x += a % 10, a /= 10;
    while (b) y *= b % 10, b /= 10;
    if( x < y ) swap( x , y );
    cout << x << y;
    return 0;
}

RC-v6 拼瓷砖

每次去额外检查一行或一列即可

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define mp make_pair

int32_t main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    int n, m;
    cin >> n >> m;
    vector<string> g(n);
    map<pair<char, int>, int> cnt;
    for (auto &i: g)
        cin >> i;
    for (int i = 0, t, f, s; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (g[i][j] == '*') continue;
            t = 0, f = 1, s = g[i][j];
            while (f) {
                if (i + t >= n || j + t >= m || s != g[i + t][j + t]) f = 0;
                for (int k = i, v = j + t; f && k <= i + t; k++)
                    if (g[k][v] != s) f = 0;
                for (int k = j, v = i + t; f && k <= j + t; k++)
                    if (g[v][k] != s) f = 0;
                for (int k = i, v = j + t; f && k <= i + t; k++)
                    g[k][v] = '*';
                for (int k = j, v = i + t; f && k <= j + t; k++)
                    g[v][k] = '*';
                t += f;
            }
            cnt[mp(s, t)]++;
        }
    }
    cout << cnt.size() << "\n";
    for (auto [k, v]: cnt)
        cout << "color = " << k.first << "; size = " << k.second << "; amount = " << v << "\n";

    return 0;
}

RC-v7 燕归来

用两个set就行

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define mp make_pair

int32_t main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    int n;
    string x;
    set<string> a, b;
    for (cin >> n; n; n--)
        cin >> x, a.insert(x);
    for (cin >> n; n; n--) {
        cin >> x;
        if (a.count(x)) a.erase(x);
        else b.insert(x);
    }
    if (a.empty()) cout << "All Back\n";
    else {
        cout << "Missing: " << a.size() << "\n";
        for (auto i: a)
            cout << i << "\n";
    }
    if (b.empty()) cout << "All Known\n";
    else {
        cout << "New: " << b.size() << "\n";
        for (auto i: b)
            cout << i << "\n";
    }
    return 0;
}

标签:cout,int,nullptr,cin,long,2022,tie,省赛,RoboCom
From: https://www.cnblogs.com/PHarr/p/17553440.html

相关文章

  • QOJ 6504. CCPC Final 2022 D Flower's Land 2题解
    QOJ6504.CCPCFinal2022DFlower'sLand2题解题意简述给你一个只含\(0,1,2\)的序列,相邻两个相同的数字可以直接消掉。询问包含两种区间所有数\(+1\)并对\(3\)取模。求一段区间能否用上述消除方式消完。样例输入8901211012245236168168236......
  • 2022 省队二轮集训培训日记-Day7
    模拟赛T1这个题一看就非常DP,考虑设$f_i$表示跳到$i$的最优解,但是发现无法转移。为什么?考虑从$j$跳到$i$时,我们除了考虑$j$与$i$之间的$x$需要满足$x+a_x<i$之外,对于$x<j$,我们仍然有同样的限制。所以这个限制我们干脆再开一维记一下,设$f_{i,x}$表示对于$j......
  • 2022 省队二轮集训培训日记-Day5
    模拟赛T1非常简单的构造,但是我忘了判断$m=2$和对只有一个点特判的输出错误,导致挂成$20$。具体思路,考虑欧拉路径只能有两个奇点,但是每条边上中间的都是奇点,所以我们需要删掉边缘的一些边,直到剩下两个奇点,然后对于$n,m$都是偶数,或者一个偶数一个奇数,或者两个都是奇数来分别......
  • 2022 省队二轮集训培训日记-Day4
    模拟赛T1首先是曼哈顿距离到切比雪夫距离的转化,到原点曼哈顿距离为定值$a$的点组成的图形为一个斜正方形,且原点到顶点的距离为$a$,正方形边长为$\sqrt{2}a$,而到原点切比雪夫距离为$a$的点组成的图形为正正方形,且边长为$2a$,那么我们可以通过把平面坐标系旋转$45$度,并把......
  • 2022 省队二轮集训培训日记 Day1
    模拟赛这里的题解在出题人的基础上进行补充。T1原题链接首先忽略所有全开的子树(在这样的子树内我们不应该选择任何路径),选一个关的点作为根设$f_{u,0/1,0/1/2}$表示满足条件$u$最后是关/开的,子树内其它点最后都是开的子树内有0/1/2个路径端点,其它端点为$u$的最小......
  • 神策数据荣获亚马逊云科技“2022 年度独立软件开发(ISV)合作伙伴”称号
    近日,以“共见·价值成就”为主题的亚马逊云科技中国合作伙伴峰会成功举办。神策数据荣获亚马逊云科技“2022年度独立软件开发(ISV)合作伙伴”称号!“2022年度独立软件开发(ISV)合作伙伴”是亚马逊云科技与神策数据合作共赢的标志,它见证了双方依托亚马逊云科技ISV全成长路径,从能力构......
  • 2022ICPC杭州站 A (裴蜀 + 扩欧)
    题目链接:A题意:给定一个序列\(a\),让序列加上一个等差序列,求出总和%$m$的最小值以及等差序列的\(s\)和公差\(d\)。思路:定义\(a\)序列总和为sum。则求解的答案为\((sum+n∗s+n∗(n+1)2∗d)\)%m的最小值。根据裴蜀定理得到原式等于\(sum+x∗gcd(n,n∗(n+1)/2)+y......
  • 2021 robocom 世界机器人开发者大赛-本科组(初赛)
    7-1懂得都懂题目描述:7-1懂的都懂众所周知,在互联网上有很多话是不好直接说出来的,不过一些模糊的图片仍然能让网友看懂你在说什么。然而对这种言论依然一定要出重拳,所以请你实现一个简单的匹配算法。现在我们采集了原图的一些特征数据,由N个小于255的非负整数组成,假设对于......
  • 【专题】2022年中国跨境电商行业研究报告PDF合集分享(附原数据表)
    报告链接:http://tecdat.cn/?p=32044近年来,我国的跨境电子商务发展迅速,在过去五年中,其贸易额增长率达到了16.2%,已经成为稳定对外贸易的一支重要力量(查看文末了解报告PDF版本免费获取方式)。一方面,随着跨境电子商务的发展,跨境电子商务的监管政策得到了进一步的改善,跨境电子商务的规......
  • P8339 [AHOI2022] 钥匙 思考--zhengjun
    很容易考虑到计算贡献。该问题的关键在于——如何使得钥匙和宝箱的对应关系不算重Warning:有这样的二元对应关系,可以考虑一下转化为括号序列!转化为括号序列之后,发现路径上括号串的对应关系能够预处理出来。套个虚树和扫描线,就做完了。代码#include<bits/stdc++.h>using......