Submission #105875

#TimeUsernameProblemLanguageResultExecution timeMemory
105875leonardaKartomat (COCI17_kartomat)C++14
80 / 80
3 ms512 KiB
#include<bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define F first #define S second typedef pair<int, int> pi; typedef long long int lint; const int inf = 0x3f3f3f3f; const int maxn = 0; int n; char tip[4][8]; string s[55]; string poc; bool moze[30]; bool fuki(string t) { for(int i = 0; i < poc.size(); ++i) if(t[i] != poc[i]) return 0; return 1; } int main () { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); tip[0][0] = tip[0][1] = tip[0][2] = tip[3][7] = tip[3][6] = tip[3][5] = '*'; int cur = 0; for(int i = 0; i < 4; ++i) { for(int j = 0; j < 8; ++j) { if(tip[i][j] != '*') { tip[i][j] = cur + 'A'; ++cur; } } } cin >> n; for(int i = 0; i < n; ++i) cin >> s[i]; cin >> poc; for(int i = 0; i < n; ++i) if(fuki(s[i])) moze[s[i][poc.size()] - 'A'] = 1; for(int i = 0; i < 4; ++i) { for(int j = 0; j < 8; ++j) { if(tip[i][j] != '*') if( ! moze[tip[i][j] - 'A']) tip[i][j] = '*'; cout << tip[i][j]; } cout << endl; } return 0; }

Compilation message (stderr)

kartomat.cpp: In function 'bool fuki(std::__cxx11::string)':
kartomat.cpp:19:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i < poc.size(); ++i)
                 ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...