QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#258709 | #1965. Trio | huzi | WA | 0ms | 4332kb | C++14 | 1.4kb | 2023-11-20 00:31:03 | 2023-11-20 00:31:04 |
Judging History
answer
#include "iostream"
#include "algorithm"
#include "cstdio"
#include "map"
#include "cmath"
using namespace std;
int main(){
int t, p, r = 0, e, mp[100000];
long long ans = 0;
int x[100000], y;
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>t;
cout<<t<<endl;
for(int i = 0; i < t; i++){
cin>>y;
if(mp[y] == 0){
x[r ++] = y;
mp[y] = 1;
}
else mp[y] += 1;
}
for(int i = 0; i < r; i++) {
if(mp[x[i]] >= 3){
long long d = 1;
for(int u = mp[x[i]]; u >= mp[x[i]] - 2; u --){
d *= u;
}
ans += d / 6;
}
for(int j = i + 1; j < r; j ++){
for(int k = j + 1; k < r; k ++){
int flag = 0;
int n = 10;
for(int z = 1; z <= 4; z ++){
if((x[i] % (int)pow(n, z))/(int)pow(n, z - 1) == (x[j] % (int)pow(n, z))/(int)pow(n, z - 1) && (x[i] % (int)pow(n, z))/(int)pow(n, z - 1) == (x[k] % (int)pow(n, z))/(int)pow(n, z - 1) || (x[i] % (int)pow(n, z))/(int)pow(n, z - 1) != (x[j] % (int)pow(n, z))/(int)pow(n, z - 1) && (x[i] % (int)pow(n, z))/(int)pow(n, z - 1) !=(x[k] % (int)pow(n, z))/(int)pow(n, z - 1)&& (x[j] % (int)pow(n, z))/(int)pow(n, z - 1) != (x[k] % (int)pow(n, z))/(int)pow(n, z - 1))
continue;
else {
flag = 1;
break;
}
}
if(!flag){
ans += mp[x[i]] * mp[x[j]] * mp[x[k]];
}
}
}
}
cout<<ans<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 4332kb
input:
4 1234 2345 3456 4567
output:
4 4
result:
wrong output format Extra information in the output file