Submission #994021

# Submission time Handle Problem Language Result Execution time Memory
994021 2024-06-07T03:09:55 Z vjudge1 Kartomat (COCI17_kartomat) C++17
80 / 80
1 ms 348 KB
#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

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 time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct