#include <stdio.h>
int main() {
int N, S; // 宣告 N 為技能數量,S 為技能等級的暫存變數
int A = 0, B = 0, C = 0, D = 0; // A, B, C, D 分別代表四位玩家的 C 指數計數
int i;
// 第一位玩家的技能數據
scanf("%d", &N
); // 輸入第一位玩家技能數量 for (i = 0; i < N; i++) {
scanf("%d", &S
); // 輸入每個技能的等級 if (S > A) // 如果當前技能等級 S 大於 A 的目前值
A = A + 1; // 計數 A 加 1,表示達到該條件的技能數量
}
// 第二位玩家的技能數據
scanf("%d", &N
); // 輸入第二位玩家技能數量 for (i = 0; i < N; i++) {
if (S > B) // 如果當前技能等級 S 大於 B 的目前值
B = B + 1; // 計數 B 加 1,表示達到該條件的技能數量
}
// 第三位玩家的技能數據
scanf("%d", &N
); // 輸入第三位玩家技能數量 for (i = 0; i < N; i++) {
if (S > C) // 如果當前技能等級 S 大於 C 的目前值
C = C + 1; // 計數 C 加 1,表示達到該條件的技能數量
}
// 第四位玩家的技能數據
scanf("%d", &N
); // 輸入第四位玩家技能數量 for (i = 0; i < N; i++) {
if (S > D) // 如果當前技能等級 S 大於 D 的目前值
D = D + 1; // 計數 D 加 1,表示達到該條件的技能數量
}
// 依據 A, B, C, D 的值由大到小輸出
// 優先比較 D 的大小,從而排列 C、B、A
if (D >= C && D >= B && D >= A) { // 若 D 最大
if (C >= B && C >= A) { // C 排第二
if (B >= A) { // 若 B >= A,順序為 B, A
} else { // 否則順序為 A, B
}
} else if (B >= C && B >= A) { // 若 B 排第二
if (C >= A) { // 若 C >= A,順序為 C, A
} else { // 否則順序為 A, C
}
} else { // 若 A 排第二
if (C >= B) { // 若 C >= B,順序為 C, B
} else { // 否則順序為 B, C
}
}
}
// 接下來的分支使用相同方式檢查 C, B, A 誰最大
else if (C >= D && C >= B && C >= A) { // 若 C 最大
if (D >= B && D >= A) { // 若 D 第二大
if (B >= A) {
} else {
}
} else if (B >= D && B >= A) { // 若 B 第二大
if (D >= A) {
} else {
}
} else { // 若 A 第二大
if (D >= B) {
} else {
}
}
}
else if (B >= D && B >= C && B >= A) { // 若 B 最大
if (D >= C && D >= A) {
if (C >= A) {
} else {
}
} else if (C >= D && C >= A) {
if (D >= A) {
} else {
}
} else {
if (D >= C) {
} else {
}
}
}
else { // 若 A 最大
if (D >= C && D >= B) {
if (C >= B) {
} else {
}
} else if (C >= D && C >= B) {
if (D >= B) {
} else {
}
} else {
if (D >= C) {
} else {
}
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBOLCBTOyAvLyDlrqPlkYogTiDngrrmioDog73mlbjph4/vvIxTIOeCuuaKgOiDveetiee0mueahOaaq+WtmOiuiuaVuAogICAgaW50IEEgPSAwLCBCID0gMCwgQyA9IDAsIEQgPSAwOyAvLyBBLCBCLCBDLCBEIOWIhuWIpeS7o+ihqOWbm+S9jeeOqeWutueahCBDIOaMh+aVuOioiOaVuAogICAgaW50IGk7CgogICAgLy8g56ys5LiA5L2N546p5a6255qE5oqA6IO95pW45pOaCiAgICBzY2FuZigiJWQiLCAmTik7IC8vIOi8uOWFpeesrOS4gOS9jeeOqeWutuaKgOiDveaVuOmHjwogICAgZm9yIChpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgIHNjYW5mKCIlZCIsICZTKTsgLy8g6Ly45YWl5q+P5YCL5oqA6IO955qE562J57SaCiAgICAgICAgaWYgKFMgPiBBKSAgICAgICAvLyDlpoLmnpznlbbliY3mioDog73nrYnntJogUyDlpKfmlrwgQSDnmoTnm67liY3lgLwKICAgICAgICAgICAgQSA9IEEgKyAxOyAgIC8vIOioiOaVuCBBIOWKoCAx77yM6KGo56S66YGU5Yiw6Kmy5qKd5Lu255qE5oqA6IO95pW46YePCiAgICB9CgogICAgLy8g56ys5LqM5L2N546p5a6255qE5oqA6IO95pW45pOaCiAgICBzY2FuZigiJWQiLCAmTik7IC8vIOi8uOWFpeesrOS6jOS9jeeOqeWutuaKgOiDveaVuOmHjwogICAgZm9yIChpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgIHNjYW5mKCIlZCIsICZTKTsKICAgICAgICBpZiAoUyA+IEIpICAgICAgLy8g5aaC5p6c55W25YmN5oqA6IO9562J57SaIFMg5aSn5pa8IEIg55qE55uu5YmN5YC8CiAgICAgICAgICAgIEIgPSBCICsgMTsgIC8vIOioiOaVuCBCIOWKoCAx77yM6KGo56S66YGU5Yiw6Kmy5qKd5Lu255qE5oqA6IO95pW46YePCiAgICB9CgogICAgLy8g56ys5LiJ5L2N546p5a6255qE5oqA6IO95pW45pOaCiAgICBzY2FuZigiJWQiLCAmTik7IC8vIOi8uOWFpeesrOS4ieS9jeeOqeWutuaKgOiDveaVuOmHjwogICAgZm9yIChpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgIHNjYW5mKCIlZCIsICZTKTsKICAgICAgICBpZiAoUyA+IEMpICAgICAgLy8g5aaC5p6c55W25YmN5oqA6IO9562J57SaIFMg5aSn5pa8IEMg55qE55uu5YmN5YC8CiAgICAgICAgICAgIEMgPSBDICsgMTsgIC8vIOioiOaVuCBDIOWKoCAx77yM6KGo56S66YGU5Yiw6Kmy5qKd5Lu255qE5oqA6IO95pW46YePCiAgICB9CgogICAgLy8g56ys5Zub5L2N546p5a6255qE5oqA6IO95pW45pOaCiAgICBzY2FuZigiJWQiLCAmTik7IC8vIOi8uOWFpeesrOWbm+S9jeeOqeWutuaKgOiDveaVuOmHjwogICAgZm9yIChpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgIHNjYW5mKCIlZCIsICZTKTsKICAgICAgICBpZiAoUyA+IEQpICAgICAgLy8g5aaC5p6c55W25YmN5oqA6IO9562J57SaIFMg5aSn5pa8IEQg55qE55uu5YmN5YC8CiAgICAgICAgICAgIEQgPSBEICsgMTsgIC8vIOioiOaVuCBEIOWKoCAx77yM6KGo56S66YGU5Yiw6Kmy5qKd5Lu255qE5oqA6IO95pW46YePCiAgICB9CgogICAgLy8g5L6d5pOaIEEsIEIsIEMsIEQg55qE5YC855Sx5aSn5Yiw5bCP6Ly45Ye6CiAgICAvLyDlhKrlhYjmr5TovIMgRCDnmoTlpKflsI/vvIzlvp7ogIzmjpLliJcgQ+OAgULjgIFBCiAgICBpZiAoRCA+PSBDICYmIEQgPj0gQiAmJiBEID49IEEpIHsgLy8g6IulIEQg5pyA5aSnCiAgICAgICAgcHJpbnRmKCJEICIpOwogICAgICAgIGlmIChDID49IEIgJiYgQyA+PSBBKSB7IC8vIEMg5o6S56ys5LqMCiAgICAgICAgICAgIHByaW50ZigiQyAiKTsKICAgICAgICAgICAgaWYgKEIgPj0gQSkgeyAvLyDoi6UgQiA+PSBB77yM6aCG5bqP54K6IEIsIEEKICAgICAgICAgICAgICAgIHByaW50ZigiQiBBXG4iKTsKICAgICAgICAgICAgfSBlbHNlIHsgICAgICAvLyDlkKbliYfpoIbluo/ngrogQSwgQgogICAgICAgICAgICAgICAgcHJpbnRmKCJBIEJcbiIpOwogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIGlmIChCID49IEMgJiYgQiA+PSBBKSB7IC8vIOiLpSBCIOaOkuesrOS6jAogICAgICAgICAgICBwcmludGYoIkIgIik7CiAgICAgICAgICAgIGlmIChDID49IEEpIHsgLy8g6IulIEMgPj0gQe+8jOmghuW6j+eCuiBDLCBBCiAgICAgICAgICAgICAgICBwcmludGYoIkMgQVxuIik7CiAgICAgICAgICAgIH0gZWxzZSB7ICAgICAgLy8g5ZCm5YmH6aCG5bqP54K6IEEsIEMKICAgICAgICAgICAgICAgIHByaW50ZigiQSBDXG4iKTsKICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSB7IC8vIOiLpSBBIOaOkuesrOS6jAogICAgICAgICAgICBwcmludGYoIkEgIik7CiAgICAgICAgICAgIGlmIChDID49IEIpIHsgLy8g6IulIEMgPj0gQu+8jOmghuW6j+eCuiBDLCBCCiAgICAgICAgICAgICAgICBwcmludGYoIkMgQlxuIik7CiAgICAgICAgICAgIH0gZWxzZSB7ICAgICAgLy8g5ZCm5YmH6aCG5bqP54K6IEIsIEMKICAgICAgICAgICAgICAgIHByaW50ZigiQiBDXG4iKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIC8vIOaOpeS4i+S+hueahOWIhuaUr+S9v+eUqOebuOWQjOaWueW8j+aqouafpSBDLCBCLCBBIOiqsOacgOWkpwogICAgZWxzZSBpZiAoQyA+PSBEICYmIEMgPj0gQiAmJiBDID49IEEpIHsgLy8g6IulIEMg5pyA5aSnCiAgICAgICAgcHJpbnRmKCJDICIpOwogICAgICAgIGlmIChEID49IEIgJiYgRCA+PSBBKSB7IC8vIOiLpSBEIOesrOS6jOWkpwogICAgICAgICAgICBwcmludGYoIkQgIik7CiAgICAgICAgICAgIGlmIChCID49IEEpIHsKICAgICAgICAgICAgICAgIHByaW50ZigiQiBBXG4iKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHByaW50ZigiQSBCXG4iKTsKICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSBpZiAoQiA+PSBEICYmIEIgPj0gQSkgeyAvLyDoi6UgQiDnrKzkuozlpKcKICAgICAgICAgICAgcHJpbnRmKCJCICIpOwogICAgICAgICAgICBpZiAoRCA+PSBBKSB7CiAgICAgICAgICAgICAgICBwcmludGYoIkQgQVxuIik7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBwcmludGYoIkEgRFxuIik7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgeyAvLyDoi6UgQSDnrKzkuozlpKcKICAgICAgICAgICAgcHJpbnRmKCJBICIpOwogICAgICAgICAgICBpZiAoRCA+PSBCKSB7CiAgICAgICAgICAgICAgICBwcmludGYoIkQgQlxuIik7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBwcmludGYoIkIgRFxuIik7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICBlbHNlIGlmIChCID49IEQgJiYgQiA+PSBDICYmIEIgPj0gQSkgeyAvLyDoi6UgQiDmnIDlpKcKICAgICAgICBwcmludGYoIkIiKTsKICAgICAgICBpZiAoRCA+PSBDICYmIEQgPj0gQSkgewogICAgICAgICAgICBwcmludGYoIkQgIik7CiAgICAgICAgICAgIGlmIChDID49IEEpIHsKICAgICAgICAgICAgICAgIHByaW50ZigiQyBBXG4iKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHByaW50ZigiQSBDXG4iKTsKICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSBpZiAoQyA+PSBEICYmIEMgPj0gQSkgewogICAgICAgICAgICBwcmludGYoIkMgIik7CiAgICAgICAgICAgIGlmIChEID49IEEpIHsKICAgICAgICAgICAgICAgIHByaW50ZigiRCBBXG4iKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHByaW50ZigiQSBEXG4iKTsKICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHByaW50ZigiQSAiKTsKICAgICAgICAgICAgaWYgKEQgPj0gQykgewogICAgICAgICAgICAgICAgcHJpbnRmKCJEIENcbiIpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgcHJpbnRmKCJDIERcbiIpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgZWxzZSB7IC8vIOiLpSBBIOacgOWkpwogICAgICAgIHByaW50ZigiQSAiKTsKICAgICAgICBpZiAoRCA+PSBDICYmIEQgPj0gQikgewogICAgICAgICAgICBwcmludGYoIkQgIik7CiAgICAgICAgICAgIGlmIChDID49IEIpIHsKICAgICAgICAgICAgICAgIHByaW50ZigiQyBCXG4iKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHByaW50ZigiQiBDXG4iKTsKICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSBpZiAoQyA+PSBEICYmIEMgPj0gQikgewogICAgICAgICAgICBwcmludGYoIkMgIik7CiAgICAgICAgICAgIGlmIChEID49IEIpIHsKICAgICAgICAgICAgICAgIHByaW50ZigiRCBCXG4iKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHByaW50ZigiQiBEXG4iKTsKICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHByaW50ZigiQiAiKTsKICAgICAgICAgICAgaWYgKEQgPj0gQykgewogICAgICAgICAgICAgICAgcHJpbnRmKCJEIENcbiIpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgcHJpbnRmKCJDIERcbiIpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgCiAgICByZXR1cm4gMDsKfQ==