Code Submission Evaluation System Login

CSES - HIIT Open 2018

HIIT Open 2018

Contest start:2018-05-26 11:00:00
Contest end:2018-05-26 16:00:00

Task list | Submit code | Submissions | Messages | Scoreboard | Statistics


History
2018-05-26 13:13:51
2018-05-26 13:08:09
2018-05-26 12:39:47
2018-05-26 12:26:24
Task:Alien Invasion
Sender:Puhi~
Submission time:2018-05-26 13:13:51
Status:READY
Result:ACCEPTED

Show test data

Code

#include <iostream>
#include <cmath>

using namespace std;

inline bool less_brutal(unsigned long long n) {
    unsigned long long x = sqrt(n);
    if (x*x == n || (x+1)*(x+1) == n) {
        return true;
    }
    return false;
}

int main() {
    unsigned long long n;
    cin >> n;

    if (less_brutal(n)){
        cout << "odd" << endl;
    } else {
        cout << "even" << endl;
    }
    return 0;
}