Accepted
Code
#include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
using ll = long long;
int main() {
FAST;
int x, y, z;
cin >> x >> y >> z;
set<int> st = {x, y, z};
vector<int> a = {x, y, z};
sort(a.begin(), a.end());
if (a[0] + a[1] > a[2]) {
if ((int)st.size() == 1) cout << "Equilateral" << "\n";
else if ((int)st.size() == 2) cout << "Isosceles" << "\n";
else cout << "Scalene" << "\n";
} else {
cout << "Not a triangle" << "\n";
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1108 Triangle Triangle Triangle!!!
- Contest
- Brain Booster #8
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-02-17 16:45:54
- Judged At
- 2025-02-17 16:45:54
- Judged By
- Score
- 100
- Total Time
- 4ms
- Peak Memory
- 564.0 KiB