답안 #105875

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
105875 2019-04-15T12:16:14 Z leonarda Kartomat (COCI17_kartomat) C++14
80 / 80
3 ms 512 KB
#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

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)
                 ~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 512 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 3 ms 384 KB Output is correct
6 Correct 3 ms 384 KB Output is correct
7 Correct 3 ms 512 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 3 ms 384 KB Output is correct
10 Correct 3 ms 284 KB Output is correct