답안 #157572

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
157572 2019-10-12T13:10:04 Z dcj Elder (COCI19_elder) C++14
20 / 50
2 ms 376 KB
#include <iostream>

using namespace std;

char Z1, Z2, p;
int N, br=1, v[30];
	
int main()
{
	cin >> p;
	cin >> N;
	v[p - 'A'] = 1;
	for (int i=1; i<=N;i++) {
		cin >> Z1 >> Z2;
		if (Z2==p) {
			v[Z1 - 'A']=1;
			p=Z1;
		}
	}
	for (int i=0;i<=26;i++) 
		br+=v[i];
	cout << p << endl;
	cout << br;
	
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 2 ms 376 KB Output is partially correct
2 Partially correct 2 ms 256 KB Output is partially correct
3 Partially correct 2 ms 376 KB Output is partially correct
4 Partially correct 2 ms 256 KB Output is partially correct
5 Partially correct 2 ms 376 KB Output is partially correct
6 Partially correct 2 ms 376 KB Output is partially correct
7 Partially correct 2 ms 252 KB Output is partially correct
8 Partially correct 2 ms 376 KB Output is partially correct
9 Partially correct 2 ms 256 KB Output is partially correct
10 Partially correct 2 ms 256 KB Output is partially correct