QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#258091#1965. TrioczrqWA 0ms3540kbC++141.2kb2023-11-19 15:03:452023-11-19 15:03:46

Judging History

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

  • [2023-11-19 15:03:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3540kb
  • [2023-11-19 15:03:45]
  • 提交

answer

#include<iostream>

using namespace std;

bool check(int x, int y, int z){
	if (x == y&&x == z){
		return true;
	}
	int tx, ty, tz;
	tx = x / 1000;
	ty = y / 1000;
	tz = z / 1000;
	if (!(((tx == ty) && (tx == tz)&&(ty==tz)) || ((tx!=ty) && (tx != tz) && (ty != tz)))){
		return false;
	}
	tx = (x%1000) / 100;
	ty = (x % 1000) / 100;
	tz = (x % 1000) / 100;
	if (!(((tx == ty) && (tx == tz) && (ty == tz)) || ((tx != ty) && (tx != tz) && (ty != tz)))){
		return false;
	}
	tx = (x % 100) / 10;
	ty = (x % 100) / 10;
	tz = (x % 100) / 10;
	if (!(((tx == ty) && (tx == tz) && (ty == tz)) || ((tx != ty) && (tx != tz) && (ty != tz)))){
		return false;
	}
	tx = x % 10;
	ty = y % 10;
	tz = z % 10;
	if (!(((tx == ty) && (tx == tz) && (ty == tz)) || ((tx != ty) && (tx != tz) && (ty != tz)))){
		return false;
	}
	return true;
}

int main(){
	int a[2003],n,coun=0,x,y,z;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 0; i < n; i++){
		for (int j = i + 1; j < n; j++){
			for (int k = j + 1; k < n; k++){
				x = a[i];
				y = a[j];
				z = a[k];
				if (check(x, y, z)){
					cout << x << endl;
					cout << y << endl;
					cout << z << endl;
					coun++;
				}
			
			}
		}
	}
	cout << coun;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3540kb

input:

4
1234
2345
3456
4567

output:

1234
2345
3456
1234
2345
4567
1234
3456
4567
2345
3456
4567
4

result:

wrong answer 1st lines differ - expected: '4', found: '1234'