编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#20692 #2041. 哈夫克机密通讯 Accepted 100 40 ms 420 K C++ 17 / 1.3 K 192024214296 2024-12-14 10:42:37
显示原始代码
#include <bits/stdc++.h>
#define lowbit(x) x&(-x)

#define pb push_back

#define pf push_front

#define ll long long

#define forn(i, n) for (int i = 0; i < int(n); i++)

#define FOR(i, s, n) for (int i = int(s); i <= int(n); i++)

#define lc c[x][0]

#define rc c[x][1]

using namespace std;
const ll LL_MAX = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
const double pi = 4 * atan(1);
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<int, pair<int, int>> PIII;  //分别表示边的权重 边两顶点
int bitcount(int x) { return x == 0 ? 0 : bitcount(x / 2) + (x & 1); }

inline string strRead() {
    string res;
    char ch = getchar();
    while (ch == ' ' || ch == '\n' || ch == '\t') ch = getchar();
    while (ch != ' ' && ch != '\n' && ch != '\t') res += ch, ch = getchar();
    return res;
}

void solve() {
    string str;
    cin >> str;
    vector<string> mp(10);
    mp[0] = "-----";
    mp[1] = ".----";
    mp[2] = "..---";
    mp[3] = "...--";
    mp[4] = "....-";
    mp[5] = ".....";
    mp[6] = "-....";
    mp[7] = "--...";
    mp[8] = "---..";
    mp[9] = "----.";
    mp[0] = "-----";
    string ans;
    for (char& i : str) {
        ans += mp[i - '0'];
    }
    cout << ans << "\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int t = 1;
    //	cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:4 ms
内存:328 KiB

输入文件(1.in

281

答案文件(1.out

..------...----

用户输出

..------...----

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:4 ms
内存:324 KiB

输入文件(2.in

501

答案文件(2.out

.....-----.----

用户输出

.....-----.----

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:4 ms
内存:324 KiB

输入文件(3.in

420

答案文件(3.out

....-..--------

用户输出

....-..--------

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:4 ms
内存:412 KiB

输入文件(4.in

526

答案文件(4.out

.......----....

用户输出

.......----....

系统信息

Exited with return code 0
测试点 #5
Accepted
得分:100
用时:4 ms
内存:324 KiB

输入文件(5.in

643

答案文件(5.out

-........-...--

用户输出

-........-...--

系统信息

Exited with return code 0
测试点 #6
Accepted
得分:100
用时:4 ms
内存:412 KiB

输入文件(6.in

918

答案文件(6.out

----..-------..

用户输出

----..-------..

系统信息

Exited with return code 0
测试点 #7
Accepted
得分:100
用时:4 ms
内存:320 KiB

输入文件(7.in

120

答案文件(7.out

.----..--------

用户输出

.----..--------

系统信息

Exited with return code 0
测试点 #8
Accepted
得分:100
用时:4 ms
内存:328 KiB

输入文件(8.in

466

答案文件(8.out

....--....-....

用户输出

....--....-....

系统信息

Exited with return code 0
测试点 #9
Accepted
得分:100
用时:4 ms
内存:320 KiB

输入文件(9.in

516

答案文件(9.out

......-----....

用户输出

......-----....

系统信息

Exited with return code 0
测试点 #10
Accepted
得分:100
用时:4 ms
内存:420 KiB

输入文件(10.in

548

答案文件(10.out

.........----..

用户输出

.........----..

系统信息

Exited with return code 0