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.|

RGB7312 - Тооны факториал

Өгөгдсөн тоо ямар нэгэн тооны факториал бол тэр тоог хэвлэ. Үгүй бол No гэж хэвлэ.

Input

Бүхэл тоо өгөгдөнө.

Output

Өгөгдсөн тоо ямар нэгэн тооны факториал бол тэр тоог үгүй бол No.

Example

Input 1:
24

Output 1:
4
Input 2:
10
Output 2:
No
Input 2:
1 Output 2: 1


Нэмсэн: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-07-10 03:51:48
shalgagch ni buruu baigamu yaaltchgui zow garaad bhad buruu geed bhin
2021-07-05 18:41:52
#include <iostream>
using namespace std;

int main() {
// your code goes here
int a;
scanf("%d", &a);
int i=1;
while(a%i==0){
a/=i;
i++;
}
if(a==1){
printf("%d", (i-1));
}
else{
printf("No");
}
return 0;
} /You are welcome!/
2021-04-01 05:05:24
#include <stdio.h>

int main(void){
int n, i, s;
scanf("%d", &n);
for(i=1, s=1 ; s<n ; i++)
s=s*i;
if(s==n)
printf("Yes");
else
printf("No");
return 0;
} shalgagch ni aldaatai bno
2021-01-03 12:49:19
factorial gejyu bile
2020-12-08 12:37:38
easy peasy xD
#include <iostream>
#include <cmath>

using namespace std;

int main(){
int num, counter = 2;
cin >> num;

if(num == 0 || num == 1) {
cout << 1;
return 0;
}
while(num % counter == 0 && sqrt(num) > counter){
num /= counter;
counter ++;
}

if(num == counter) cout << counter << endl;
else cout << "No" << endl;


return 0;
}
2020-11-14 05:09:37
Thank me later
Thank me later
#include <iostream>
#include <math.h>

using namespace std;

int main() {

int n, s = 1, i = 0;

cin >> n;

if ( n == 1 ) {
cout << 1;
} else {

while( n > s ) {
i++;
s = s * i;
}
if ( n == s) {
cout << i;
} else{
cout <<"No";
}
}
return 0;
}

2020-10-11 05:09:56
#include <cstdio>
int main(){
int a,i=1;
scanf("%d", &a);
while(a%i==0){
a=a/i;
i++;
}
if(a==1) printf("%d", i-1);
else printf("No");
return 0;
}
2 ez
2020-10-10 17:37:33
#include <stdio.h>

int main()
{
int a,sum = 1;
scanf("%d",&a);
for(int i = 1; i < a; i ++)
{
sum = sum * i;
if(sum == a)
{
printf("%d",i);break;
}
}
if(sum != a)
printf("NO");
} buruu genu ?
2020-08-28 10:47:15
*_*

Last edit: 2020-08-28 10:48:42
2020-07-30 07:52:01
факториал тоо гэж ямар тоо байдын
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.