QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#258709#1965. TriohuziWA 0ms4332kbC++141.4kb2023-11-20 00:31:032023-11-20 00:31:04

Judging History

你现在查看的是最新测评结果

  • [2023-11-20 00:31:04]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4332kb
  • [2023-11-20 00:31:03]
  • 提交

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;
}

詳細信息

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