QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#715975#9578. 爱上字典qzez#WA 2ms19612kbC++14952b2024-11-06 13:58:102024-11-06 13:58:11

Judging History

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

  • [2024-11-06 13:58:11]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:19612kb
  • [2024-11-06 13:58:10]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int maxn=500006;
int read(){
    int ret=0,f=1;char ch=getchar();
    while(!isdigit(ch)){if(ch=='-')f=-f;ch=getchar();}
    while( isdigit(ch)){ret=(ret<<3)+(ret<<1)+(ch&15);ch=getchar();}
    return ret*f;
}
string s[maxn],c;
set<string> mp;
int n,num;
int main(){
    while(1){
        cin>>c;
        int len=c.length();
        if(isdigit(c[0])){
            for(int i=0;i<len;++i){
                n=n*10+c[i]-'0';
            }
            break;
        }
        ++num;
        if(isupper(c[0])) c[0]=c[0]-'A'+'a';
        for(int i=0;i<len;++i){
            s[num]=s[num]+c[i];
        }
    }
    for(int i=1;i<=n;++i){
        cin>>c;
        mp.insert(c);
    }
    int ans=0;
    for(int i=1;i<=num;++i){
        if(mp.find(s[i])==mp.end()){
            mp.insert(s[i]);
            ans++;
        }
    }
    printf("%d\n",ans);
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 19612kb

input:

I love Liaoning. Love Dalian!
1
love

output:

3

result:

ok single line: '3'

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 19328kb

input:

Sulfox Loves Furry! Fur fur Furred.
2
anthropomorphic furry

output:

5

result:

wrong answer 1st lines differ - expected: '4', found: '5'