Submission #994024

#TimeUsernameProblemLanguageResultExecution timeMemory
994024vjudge1Kartomat (COCI17_kartomat)C++17
80 / 80
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; string a[n]; for (int i = 0; i < n; i ++) cin >> a[i]; string s; cin >> s; vector<int> possible; for (int i = 0; i < n; i ++){ if (a[i].size() <= s.size()) continue; bool bad = 0; for (int j = 0; j < s.size(); j ++){ if (a[i][j] != s[j]){ bad = 1; } } if (bad) continue; possible.push_back(a[i][s.size()] - 'A' + 3); } char mat[4][8]; for (int i = 0; i < 4; i ++) for (int j = 0; j < 8; j ++) mat[i][j] = '*'; for (int x : possible){ char ch = char(x - 3 + 'A'); int r = x / 8; int c = x % 8; mat[r][c] = ch; } for (int i = 0; i < 4; i ++){ for (int j = 0; j < 8; j ++) cout << mat[i][j]; cout << endl; } }

Compilation message (stderr)

kartomat.cpp: In function 'int main()':
kartomat.cpp:17:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |         for (int j = 0; j < s.size(); j ++){
      |                         ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...