Submission #994021

#TimeUsernameProblemLanguageResultExecution timeMemory
994021vjudge1Kartomat (COCI17_kartomat)C++17
80 / 80
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; string l[n]; for (int i=0;i<n;i++) cin>>l[i]; string s; cin>>s; int m=s.size(); string ans=""; for (int i=0;i<32;i++) ans+='*'; for (int i=0;i<n;i++) { string s1=""; if (l[i].size()<m) continue; for (int j=0;j<m;j++) s1+=l[i][j]; if (s1!=s) continue; ans[(l[i][m]-'A')+3]=l[i][m]; } for (int j=0;j<4;j++) { for (int i=j*8;i<(j+1)*8;i++) cout<<ans[i]; cout<<endl; } return 0; }

Compilation message (stderr)

kartomat.cpp: In function 'int main()':
kartomat.cpp:21:18: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   21 |   if (l[i].size()<m)
      |       ~~~~~~~~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...