QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#176339 | #5682. PSET | yyc4591 | WA | 0ms | 3572kb | C++14 | 1.1kb | 2023-09-11 15:43:35 | 2023-09-11 15:43:35 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int n;
cin >> n;
vector<pair<string, string>>v;
for (int i = 0; i < n; i++)
{
string s, t;
cin >> s >> t;
v.push_back({s, t});
}
auto check =[&](pair<string, string> a, pair<string, string>b, pair<string, string> c)
{
string aa, bb, cc;
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
for (int k = 0; k < 2; k++) {
if(i)
aa = a.first;
else
aa = a.second;
if(j)
bb = a.first;
else
bb = a.second;
if(k)
cc = a.first;
else
cc = a.second;
for (int i = 0; i < 4; i++)
{
if( (aa[i] == bb[i] && bb[i] == cc[i]) || (aa[i] != bb[i] && aa[i] != cc[i] && bb[i] != cc[i]) )
return 1;
}
}
}
}
return 0;
};
int ans = 0;
for (int a = 0; a < n; a++) {
for (int b = a + 1; b < n; b++) {
for (int c = b + 1; c < n; c++) {
if(check(v[a], v[b], v[c]))
ans++;
}
}
}
cout << ans << "\n";
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3572kb
input:
4 3BFD 1RED 1GSA 3GSO 3REA 1BFO 2REO 2BFA
output:
4
result:
ok single line: '4'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3532kb
input:
7 3GED 1GFD 2RSD 2BSD 1BFA 3REO 2RED 2BFD 3GSD 1GSD 3BFO 1REA 2GEA 2GFO
output:
35
result:
wrong answer 1st lines differ - expected: '1', found: '35'