#include<stdio.h> #include<string.h> int n, p1, p2; char str[11]; int main() { scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%s", str); if (!strcmp(str, "KBS1")) p1 = i; else if (!strcmp(str, "KBS2")) p2 = i; } for (int i = 0; i < p1; i++) printf("1"); for (int i = 0; i < p1; i++) printf("4"); if (p1 > p2) p2++; for (int i = 0; i < p2; i++) printf("1"); for (int i = 0; i < p2 - 1; i++) printf("4"); return 0; }
2816번: 디지털 티비
https://www.acmicpc.net/problem/2816
피드 구독하기:
댓글
(
Atom
)
댓글 없음 :
댓글 쓰기