Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
void solution() {
int A, B, C;
cin >> A >> B >> C;
int arr[3] = {A, B, C};
sort(arr, arr + 3);
if (arr[0] == arr[1] && arr[1] == arr[2]) {
cout << 0 << "\n";
} else if (arr[0] == arr[1] || arr[1] == arr[2]) {
cout << 1 << "\n";
} else {
int x=__gcd(A,B);
int y=__gcd(x,C);
cout<<y<<endl;
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int T;
cin >> T;
while (T--) {
solution();
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1061 Bring equality
- Contest
- Brain Booster #4
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-07-14 18:47:09
- Judged At
- 2024-11-11 03:22:09
- Judged By
- Score
- 10
- Total Time
- 24ms
- Peak Memory
- 580.0 KiB