QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#535891 | #7700. Split Decisions | rotcar07 | WA | 43ms | 4468kb | C++14 | 722b | 2024-08-28 16:15:44 | 2024-08-28 16:15:45 |
Judging History
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';
}
Details
Tip: Click on the bar to expand more detailed information
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'