hiho week 176 register

Ended

Participants:281

Verdict:Accepted
Score:100 / 100
Submitted:2017-11-14 21:00:03

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;
using LL = int64_t;
const LL INF = 0x3f3f3f3f;
const LL mod = 1e9 + 7;
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<string> a(n);
    vector<int> val(26);
    for (auto& i : a) {
        cin >> i;
        for (auto j : i) if (isupper(j)) val[j - 'A'] = 1;
        i += '<';
    }
    int num = accumulate(val.begin(), val.end(), 0);
    int t;
    cin >> t;
    while (t--) {
        for (int i = 0; i < num; i++) {
            char c;
            int v;
            cin >> c >> v;
            val[c - 'A'] = v;
        }
        int ans = 1;
        for (auto& i : a) {
            int flag = -1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX