Submission #721365

# Submission time Handle Problem Language Result Execution time Memory
721365 2023-04-10T18:47:30 Z vjudge1 Kartomat (COCI17_kartomat) C++17
80 / 80
1 ms 320 KB
#include <bits/stdc++.h>
#define sts stable_sort
#define B begin()
#define rB rbegin()
#define E end()
#define rE rend()
#define F first
#define S second
#define pb push_back
#define ppb pop_back()
#define pf push_front
#define ppf pop_front()
#define eb emplace_back
#define ll long long
#define ui unsigned int
#define ull unsigned long long

using namespace std;

const int MAXN = 1e6 + 4;
const int MOD = 1e9 + 7;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);

    int n; cin >> n;
    vector<string> v(n);

    for(int i = 0; i < n; i++){
        cin >> v[i];
    }
    string s; cin >> s;
    map<char, bool> m;

    for(int i = 0; i < n; i++){
        if(v[i].substr(0, s.size()) == s){
            m[v[i][s.size()]] = 1;
        }
    }

    string key = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    cout << "***";
    for(int i = 0; i < key.size(); i++){
        if(m[key[i]]){
            cout << key[i];
        }else{
            cout << "*";
        }
        if(i == 4 || i == 12 || i == 20)cout << "\n";
    }cout << "***\n";

    return 0;
}

Compilation message

kartomat.cpp: In function 'int main()':
kartomat.cpp:44:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |     for(int i = 0; i < key.size(); i++){
      |                    ~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 320 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 284 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct