QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#788231#9578. 爱上字典abovecloud#WA 88ms17120kbC++231.6kb2024-11-27 16:18:172024-11-27 16:18:17

Judging History

你现在查看的是最新测评结果

  • [2024-11-27 16:18:17]
  • 评测
  • 测评结果:WA
  • 用时:88ms
  • 内存:17120kb
  • [2024-11-27 16:18:17]
  • 提交

answer

/*** WORK : 省赛\2024大连省赛\a.cpp ***/
/*** TIME : 2024/11/27 16:08 ***/
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define pb push_back
#define se second
#define fi first
#define int long long
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
const int MOD = (int)1e9 + 7;
const int INF = INT_MAX;
int p = 28;
int f(char c)
{
    if (c <= 'Z' && c >= 'A')
    {
        return (c - 'A' + 1);
    }
    if (c <= 'z' && c >= 'a')
    {
        return (c - 'a' + 1);
    }
    return 0;
}

void solve()
{
    string s;
    getline(cin,s);
    set<int> mp;
    int cur = 0;
    int len = 0;
    // cout << s << endl;
    for (char c:s)
    {
        int t = f(c);
        if(t==0){
            // cout << cur << endl;
            if(cur > 0 && len <= 20){
                mp.insert(cur);
            }
            cur = 0;
            len = 0;
        }else{
            cur = cur * p + t;
            len ++;
        }
    }
    if(cur > 0 && len <= 20){
        mp.insert(cur);
    }
    int n;
    cin >> n;
    while(n--){
        string ss;
        cin >> ss;
        int res = 0;
        for(char c:ss){
            res = res * p + f(c);
        }
        if(mp.count(res)){
            mp.erase(res);
        }
    }

    cout << mp.size() << endl;
}

int32_t main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(12);
    int T = 1;
    T = 1;
    while (T--)
        solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3588kb

input:

I love Liaoning. Love Dalian!
1
love

output:

3

result:

ok single line: '3'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3476kb

input:

Sulfox Loves Furry! Fur fur Furred.
2
anthropomorphic furry

output:

4

result:

ok single line: '4'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

Ginkgo leaves dance lightly and fall, reflecting the autumn light on the golden ground. Time is as peaceful as when we first met.
5
ginkgo reflect is as we

output:

17

result:

ok single line: '17'

Test #4:

score: -100
Wrong Answer
time: 88ms
memory: 17120kb

input:

Eunuchism overterrible furbelow gantlet. Sophism thyroiditis thermoelectricity hassel misreward Barolong biradiated? Sweetie fatal delinquence unseemlily beamish inwork, azyme kamias Hans asteatosis synderesis champleve cheth? Dinitrile podial presentee! Waxmaker scleroscope ratably hectography lamp...

output:

191481

result:

wrong answer 1st lines differ - expected: '201961', found: '191481'