QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#535890 | #7700. Split Decisions | rotcar07 | WA | 43ms | 5048kb | C++14 | 729b | 2024-08-28 16:14:08 | 2024-08-28 16:14:12 |
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]*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'