Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
RGB7310 - Хоёрын зэрэгт |
Өгөгдсөн тоо хоёрын зэрэгт мөн бол YES үгүй бол NO гэж хэвлэ.
Input
Бүхэл тоо өгөгдөнө.
Output
2-ын зэрэгт бол YES үгүй бол NO.
Example
Input: 16 Output: YES
Нэмсэн: | Bataa |
Огноо: | 2013-01-11 |
Хугацааны хязгаарлалт: | 1s |
Эх кодын хэмжээний хязгаарлалт: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Програмчлалын хэлүүд: | ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE |
hide comments
|
||||||||
2021-12-18 17:08:45
#include<stdio.h> main() { double a=1,s=1,k=1,d; scanf("%lf",&d); if(d>0) { while(a) { if(d==1) { printf("YES"); a=0; } s=s*2; k=k/2; if(s>=d || k>=d) { if(s==d) { printf("YES"); a=0; } else if(k==d) { printf("YES"); a=0; } else { printf("NO"); a=0; } } } } else printf("NO"); } Yu buruu bn |
||||||||
2021-11-18 22:57:33
int a=2; Scanner sc=new Scanner(System.in); a=sc.nextInt(); while(a>=2 & a%2==0) { a=a/2; } if(a==1 ) { System.out.print("YES"); } else System.out.print("NO"); |
||||||||
2021-10-30 07:27:07
#include<iostream> #include<cmath> using namespace std; int main(){ int a,i; cin>>a; i=0; while(pow(2,i)<=a){ i=i+1; } if(pow(2,i-1)==a) cout<<"YES"; else cout<<"NO"; return 0; } |
||||||||
2021-10-28 19:16:37
2iin zeregt bish zvgeer toonii zeregt shvv |
||||||||
2021-07-20 11:47:15
#include <iostream> using namespace std; int main() { int n, a=0, i=0, s=0, x ; cin>>n; while(n>a) { i++; s=i*i; a++; if(n==s) x=s; } if(n==x) { cout<< "YES"; } else cout<<"NO"; } |
||||||||
2021-04-21 08:52:44
#include <stdio.h> bool check(int n) { while (n>1) { if (n%2!=0) {return false; break; } n=n/2; } return true; } main () { int n, b, a=0; scanf("%d",&n); if(check(n)) printf("YES"); else printf("NO"); } |
||||||||
2021-04-21 08:38:57
copy dis shit #include <bits/stdc++.h> using namespace std; int main (){ int n; cin>>n; while (n>=2 && n%2==0){ n=n/2; } if (n==1){ cout<<"YES"<<endl; } else cout<<"NO"<<endl; return 0; } |
||||||||
2021-03-22 01:31:37
#include <stdio.h> int main(void) { int n,i; scanf("%d",&n); for(;n%2==0;n/=2) i=n/2; if(i==1) printf("YES"); else printf("NO"); } ene shalgagch buruu beno |
||||||||
2020-11-06 02:15:57
#include <bits/stdc++.h> using namespace std; int main (){ int a; cin>>a; while (a>=2 && a%2==0){ a=a/2; } if (a==1){ cout<<"YES"<<endl; } else cout<<"NO"<<endl; return 0; } |
||||||||
2020-07-30 04:47:51
//right code #include <bits/stdc++.h> using namespace std; int main (){ int a; cin>>a; while (a>=2 && a%2==0){ a=a/2; } if (a==1){ cout<<"YES"<<endl; } else cout<<"NO"<<endl; return 0; } |