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 11:05:33
Task:Alien Invasion
Sender:Karhukopla
Submission time:2018-05-26 11:05:33
Status:READY
Result:ACCEPTED

Show test data

Code

#include <bits/stdc++.h>

#define ll long long
#define lll __int128
#define pii pair<int, int>
#define M 1000000007

using namespace std;

int main () {
	ll nn;
	cin>>nn;
	lll n = nn;
	lll ans = 0;
	for (lll x = n; x >= 1; x /= 2) {
		while ((ans + x) * (ans + x) <= n) ans += x;
	}
	if (ans * ans == n) {
		cout<<"odd"<<endl;
	} else {
		cout<<"even"<<endl;
	}
}