QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#260460 | #7700. Split Decisions | ItsJerr# | WA | 17ms | 3520kb | C++20 | 922b | 2023-11-22 10:34:05 | 2023-11-22 10:34:05 |
Judging History
answer
/*input
5
CELL
GULL
GUSH
HALL
HASH
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 2000;
string s[N];
int main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
for (int i = 1; i <= n; ++i)
cin >> s[i];
int ans = 0;
map<string, int> Map;
for (int j = 0; j < 19; ++j)
{
Map.clear();
for (int i = 1; i <= n; ++i)
{
for (int p = i + 1; p <= n; ++p)
{
if(s[i].size()-1<j+1) continue;
if (s[i].size() != s[p].size()) continue;
int Dif=0;
for(int o=0;o<s[i].size();++o) if(s[i][o]!=s[p][o]) ++Dif;
if(Dif!=2) continue;
if(s[i][j]!=s[p][j]&&s[i][j+1]!=s[p][j+1])
{
string z="",x="";
z=z+s[i].substr(j,2)+s[p].substr(j,2);
x=x+s[p].substr(j,2)+s[i].substr(j,2);
Map[z]++;
Map[x]++;
}
}
}
for(auto h:Map) if(h.second==1) ++ans;
}
cout << ans/2 << '\n';
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3472kb
input:
5 CELL GULL GUSH HALL HASH
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 17ms
memory: 3508kb
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:
621
result:
ok single line: '621'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3444kb
input:
14 ALTO AFRO AGENT CAMP CHEAP CHESS CLAP CORSAGE COURAGE EXTINCT EXTRACT SCENT STEEP CHUMP
output:
7
result:
ok single line: '7'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3436kb
input:
4 ABCD AEFD AGHD AIJD
output:
6
result:
ok single line: '6'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3500kb
input:
3 ABABA AABBA ABBAA
output:
2
result:
ok single line: '2'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
3 AAAAA ABBAA AABBA
output:
2
result:
ok single line: '2'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
8 ABBA ACCA AABB AACC DBBD DCCD EEBB EECC
output:
0
result:
ok single line: '0'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
6 ABBA ACCA AABB AACC DBBD DCCD
output:
1
result:
ok single line: '1'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
4 ABBA ACCA AABB AACC
output:
2
result:
ok single line: '2'
Test #10:
score: -100
Wrong Answer
time: 0ms
memory: 3520kb
input:
4 ABBA ACCA ABBAA ACCAA
output:
0
result:
wrong answer 1st lines differ - expected: '2', found: '0'