알고리즘

[알고리즘] 백준 4589 - Gnome Sequencing (C++)

blueberrysoda 2025. 3. 17. 23:24

[문제 링크] : https://www.acmicpc.net/problem/4589

#include <iostream>
#include <vector>
using namespace std;

int T;

int main(){
    cin >> T;
    cout << "Gnomes:\n";

    while(T--){
        vector <int> V(3);
        for(int i=0; i<3; i++){
            cin >> V[i];
        }
        if((V[1] - V[0]) * (V[2] - V[1]) > 0){
            cout << "Ordered\n";
        }
        else{
            cout << "Unordered\n";
        }
    }
    return 0;
}