/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 1ms 320.0 KiB
#4 Accepted 1ms 532.0 KiB
#5 Accepted 1ms 420.0 KiB
#6 Accepted 1ms 488.0 KiB
#7 Accepted 1ms 532.0 KiB
#8 Accepted 1ms 532.0 KiB
#9 Accepted 1ms 532.0 KiB
#10 Accepted 1ms 532.0 KiB
#11 Accepted 1ms 484.0 KiB
#12 Accepted 1ms 536.0 KiB
#13 Accepted 1ms 532.0 KiB
#14 Accepted 1ms 472.0 KiB
#15 Accepted 1ms 532.0 KiB
#16 Accepted 1ms 368.0 KiB
#17 Accepted 1ms 532.0 KiB
#18 Accepted 1ms 320.0 KiB
#19 Accepted 1ms 532.0 KiB
#20 Accepted 1ms 384.0 KiB
#21 Accepted 1ms 444.0 KiB
#22 Accepted 1ms 496.0 KiB
#23 Accepted 1ms 480.0 KiB
#24 Accepted 1ms 532.0 KiB
#25 Accepted 1ms 536.0 KiB
#26 Accepted 1ms 532.0 KiB
#27 Accepted 1ms 536.0 KiB
#28 Accepted 1ms 532.0 KiB
#29 Accepted 1ms 532.0 KiB
#30 Accepted 1ms 484.0 KiB

Code

// In the name of Allah the merciful.
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#define endl               '\n'
#define efficient()        ios_base::sync_with_stdio(0); cin.tie(0);
#define fraction()         cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
 
ll gcd ( ll a, ll b ) { return __gcd ( a, b ); }
ll lcm ( ll a, ll b ) { return abs(a) * ( abs(b) / gcd ( a, b ) ); }
 
int dx[] = {+1, -1, 0, 0, +1, +1, -1, -1};
int dy[] = {0, 0, -1, +1, +1, -1, +1, -1};
 
const ll mod = 1e9 + 7; // 1000000007;
const double PI = 3.14159265358979323846;
const double eps = 1e-9; // if (abs(a-b) < 1e-9) {a and b are equal}
 
/*---------------------------------------------------------------------------------------------------------------*/

bool check(int a, int b, int c)
{
    if (a + b <= c or a + c <= b or b + c <= a)
        return false;
    else
        return true;
}

void solve()
{
    int a, b, c; cin >> a >> b >> c;

    if (!check(a, b, c)) {
        cout << "Not a triangle" << endl;
        return;
    }

    if (a == b and b == c) cout << "Equilateral" << endl;
    else if (a != b and b != c and c != a) cout << "Scalene" << endl;
    else cout << "Isosceles" << endl;
}
 
int main(void) {
    efficient();
 
    int t = 1;
    // cin >> t;
    for (int tc = 1; tc <= t; tc++) {
        // cout << "Case " << tc << ": ";
        solve();
    }
 
    return 0;
    // Every problem has its weakness.
    // This problem's weakness is...the existence of me!
}

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 14:50:56
Judged At
2025-02-17 14:50:56
Judged By
Score
100
Total Time
1ms
Peak Memory
536.0 KiB