hiho week 261 register

Ended

Participants:52

Verdict:Accepted
Score:100 / 100
Submitted:2019-06-30 17:26:55

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <bits/stdc++.h>
using namespace std;
#define fora(i, l, r) for (int i = (int)(l); i < (int)(r); ++i)
#define ford(i, r, l) for (int i = (int)(r); i >= (int)(l); --i)
constexpr int MOD = 1e9 + 7;
constexpr int MAXN = 2e6 + 10;
using ll = long long;
ll N, M, K, T;
vector<string> A;
vector<string> B;
bool Helper1(map<string, int> &mp, int x, multiset<string>& ms) {
  if (x == 2) {
    for (auto &p : mp) {
      if (p.second >= 2) {
        ms.emplace(p.first);
        ms.emplace(p.first);
        set<char> ss;
        for (auto &q : ms) {
          ss.emplace(q[0]);
        }
        if (ss.size() <= 2)
          return true;
        ms.erase(ms.find(p.first));
        ms.erase(ms.find(p.first));
      }
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX