QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#258712#1965. TriohuziWA 0ms3380kbC++141.4kb2023-11-20 00:33:392023-11-20 00:33:40

Judging History

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

  • [2023-11-20 00:33:40]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3380kb
  • [2023-11-20 00:33:39]
  • 提交

answer

#include "iostream"
#include "algorithm"
#include "cstdio"
#include "map"
#include "cmath"
using namespace std;

int main(){
	int t, p, r = 0, e, mp[10000];
	long long ans = 0;
	int x[3000], y;
	ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>t;
	
	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: 100
Accepted
time: 0ms
memory: 3380kb

input:

4
1234
2345
3456
4567

output:

4

result:

ok single line: '4'

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3344kb

input:

9
1299
2399
3499
4599
5699
6799
7899
8999
9199

output:

56

result:

wrong answer 1st lines differ - expected: '84', found: '56'