QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#535891#7700. Split Decisionsrotcar07WA 43ms4468kbC++14722b2024-08-28 16:15:442024-08-28 16:15:45

Judging History

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

  • [2024-08-28 16:15:45]
  • 评测
  • 测评结果:WA
  • 用时:43ms
  • 内存:4468kb
  • [2024-08-28 16:15:44]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n;
string s[1505];
constexpr int mod=1000133;
int z[mod+5];
int main(){
    cin>>n;
    for(int i=1;i<=n;i++) cin>>s[i];
    for(int i=1;i<=n;i++)
    for(int j=i+1;j<=n;j++){
        vector<int> pos;
        for(int k=0;k<min(s[i].size(),s[j].size());k++) if(s[i][k]!=s[j][k]) pos.push_back(k);
        if(pos.size()==2&&pos[0]+1==pos[1]){
            auto w=(pos[0]*6766+((s[i][pos[0]]-'A')*26+s[i][pos[1]]-'A')*((s[j][pos[0]]-'A')*26+s[j][pos[1]]-'A'))%mod;
            // cout<<i<<' '<<j<<' '<<w<<'\n';
            if(!z[w]) z[w]=1;
            else  z[w]=-1;
        }
    }
    int ans=0;
    for(auto x:z) ans+=max(x,0);
    cout<<ans<<'\n';
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3664kb

input:

5
CELL
GULL
GUSH
HALL
HASH

output:

2

result:

ok single line: '2'

Test #2:

score: -100
Wrong Answer
time: 43ms
memory: 4468kb

input:

1000
ABSALOM
ACRATIA
AKHOOND
ALIBAMU
AMUSIVE
AGONIZE
ACOCOTL
ACTINON
ABELITE
ADVISAL
ALBETAD
AMAKEBE
ANASAZI
AMUCHCO
ADDENDA
AMESITE
ALIENEE
ADRENIN
ACERATE
AKERITE
AMPELIS
ABABDEH
ALCIDAE
AGRANIA
ALASTER
AMERISM
AMILOUN
AMYGDAL
ALUNDUM
ACHOLIC
ALTHAEA
ACIDIFY
AMNESTY
ABBOTCY
AMBALAM
AMENITY
AEOLISM...

output:

616

result:

wrong answer 1st lines differ - expected: '621', found: '616'