J想到了卡特兰数,也想到要按最小值分割数组,丢给队友之后两个人都没做出来,傻了

题目链接:https://codeforces.com/gym/102501


B:

solver:czq

 1 /* basic header */
 2 #include <bits/stdc++.h>
 3 /* define */
 4 #define ll long long
 5 #define pb emplace_back
 6 #define mp make_pair
 7 #define eps 1e-8
 8 #define lson (curpos<<1)
 9 #define rson (curpos<<1|1)
10 /* namespace */
11 using namespace std;
12 /* header end */
13 
14 int n;
15 map<string, int>m;
16 string s;
17 
18 int main() {
19     cin >> n; int mm = n;
20     while (mm--) {
21         cin >> s;
22         m[s]++;
23     }
24     for (auto i : m) {
25         if (i.second > n - i.second) {
26             cout << i.first << endl;
27             return 0;
28         }
29     }
30     cout << "NONE" << endl;
31     return 0;
32 }
View Code

相关文章: