#include #include int main() { int turn = 0; int card[6][4]; char res[6][3]; int flg[10]; for (int i = 0; i < 10; i++) flg[i] = 6; // 入力処理 scanf("%d", &turn); for (int i = 0; i < turn; i++) { // 入力処理 scanf("%d %d %d %d %s", &card[i][0], &card[i][1], &card[i][2], &card[i][3], res[i]); // 内容処理 if (strcmp(res[i], "YES") == 0) for (int j = 0; j < 4; j++) flg[card[i][j]]++; else if (strcmp(res[i], "NO") == 0) for (int j = 0; j < 4; j++) flg[card[i][j]]--; } int ans = 0; int maxflg = 0; for (int i = 0; i < 10; i++) { printf("%d : %d\n", i, flg[i]); if (maxflg < flg[i]) { maxflg = flg[i]; ans = i; } } printf("%d", ans); return 0; }