Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB8004 - 2-тын зэрэг

Тоо 2-тын зэрэг мөн эсэхийг тогтоо.

Input

Нэг тоо өгөгдөнө. / Integer төрөл /

Output

Тоо нь 2-тын зэрэг мөн бол YES, үгүй бол NO гэж хэвлэ. 

Example

Input:
8

Output:
YES
Input:
22
Output:
NO

Нэмсэн:Bataa
Огноо:2010-01-04
Хугацааны хязгаарлалт:0.100s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 ASM64 BASH BF C CSHARP C++ 4.3.2 CPP CPP14 C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON RUBY SCALA SCM guile SCM qobi ST TCL TEXT WHITESPACE

hide comments
2024-01-19 07:16:18
#include<iostream>
using namespace std;

int main() {
int a;
cin >> a;

if (a <= 0) {
cout << "NO" << endl;
} else {
while (a > 1) {
if (a % 2 != 0) {
break;
}
a /= 2;
}

if (a == 1) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}

return 0;
}
2020-03-30 15:48:02
int a,b = 1;
bool bol = false;
cin >> a;
while (b <= a)
{
if (b == a)
{
bol = true;
break;
}
b = b * 2;
}
if (bol)
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
} // negiin toog 2 iin 0 zereg dedgiig ologhui ih udlaa shuu haha
2018-03-28 06:55:26
#include<stdio.h>
#include<stdlib.h>
int main()
{
int a;
scanf("%d",&a);
while (a%2==0)
{
a=a/2;
}
if (a==1) printf("YES");
else printf("NO");
system("pause");
return 0;
}
2017-11-23 04:57:58

#include <iostream>

using namespace std;

int main(){

int e, n, i = 0;

cin >> n;

while (n > 1){
if (n % 2 == 0)
n = n / 2;
else {
n = 1;
i++;
}
}
if (i > 0)
cout << "NO" << endl;
else
cout << "YES" << endl;

return 0;
}
2016-03-19 06:28:55 serjmydag


Last edit: 2016-03-19 06:30:35
2015-03-21 13:02:24 gundalai


Last edit: 2015-03-21 13:03:43
2014-12-05 06:18:31 Steve
#include<iostream>
using namespace std;
int main(){
double a,i=1;
cin>>a;
while(i<a){i=i*2;}
if(a==i)cout<<"yes";
else cout<<"no";
system("pause");
return 0;
}
2012-12-09 05:30:52 Unurbold
1 ийг биш гээд байна
2012-11-21 05:36:40 Enhmaa
hehe mi bodlogo horvuleltin alda gd bhim...
2010-04-16 13:20:49 muis-mks-eQ
#include<iostream>
using namespace std;
int main(){
double a,i=1;
cin>>a;
while(i<a){i=i*2;}
if(a==i)cout<<"yes";
else cout<<"no";
system("pause");
return 0;
}
ene uul ni zov l ajilj bhiin yu ni bolku bgan bol helj tuslaach
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.