QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#258091 | #1965. Trio | czrq | WA | 0ms | 3540kb | C++14 | 1.2kb | 2023-11-19 15:03:45 | 2023-11-19 15:03:46 |
Judging History
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'