QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#535890#7700. Split Decisionsrotcar07WA 43ms5048kbC++14729b2024-08-28 16:14:082024-08-28 16:14:12

Judging History

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

  • [2024-08-28 16:14:12]
  • 评测
  • 测评结果:WA
  • 用时:43ms
  • 内存:5048kb
  • [2024-08-28 16:14:08]
  • 提交

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]*26+s[i][pos[0]]-'A')*26+s[i][pos[1]]-'A')*26%mod+s[j][pos[0]]-'A')*26%mod+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: 3896kb

input:

5
CELL
GULL
GUSH
HALL
HASH

output:

2

result:

ok single line: '2'

Test #2:

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

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:

700

result:

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