Submission #1300322

#TimeUsernameProblemLanguageResultExecution timeMemory
1300322tabKartomat (COCI17_kartomat)C++20
80 / 80
1 ms584 KiB
#include "bits/stdc++.h" using namespace std; #define intt int #define fi first #define se second const intt mxN = 2e5 + 5; const intt LG = 20; const intt inf = 1e18; intt n; vector<string> key(5); vector<string> label; map<char,intt> safe; void _() { key[0] = "***ABCDE"; key[1] = "FGHIJKLM"; key[2] = "NOPQRSTU"; key[3] = "VWXYZ***"; cin >> n; for(intt i = 0; i < n; i++) { string a; cin >> a; label.push_back(a); } string pre; cin >> pre; for(intt i = 0; i < n; i++){ string po = ""; for(intt j = 0; j < label[i].size(); j++) { po += label[i][j]; if(po == pre && j + 1 <= label[i].size()-1) { safe[label[i][j+1]]=1; } } } for(intt i = 0; i <= 3; i++){ for(intt j = 0; j <= 7; j++){ if(!safe[key[i][j]]) { cout << "*"; } else { cout << key[i][j]; } } cout << endl; } } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); intt t = 1, buu = 1; // cin >> t; while(t--){ // cout << "Case #" << buu++ << ": "; _(); } }

Compilation message (stderr)

kartomat.cpp:9:18: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
    9 | const intt inf = 1e18;
      |                  ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...