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
2022-06-27 11:30:18
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 CSHARP CPP C++ 4.3.2 C99 CLPS LISP clisp LISP sbcl D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE
2022-06-24 13:29:01
#include<iostream>
using namespace std;
int main()
{
long long int n,i=0,ans=1,m;
cin>>n;
m=n;
while(true){
i++;
if(n==1) {
ans=1;
break;
}
if(n%i==0) n=n/i;
else{
ans=0;
break;
}

}
if(ans==1){
i=0;
while(m>0){
i++;
m=m/i;
}
cout<<i-1;
}
else cout<<"No";
return 0;

}khandmaa to tusa
2022-04-13 12:42:40
hi
2022-03-03 12:11:54
1. Don't post any source code here.|
2. Please be careful, leave short comments only. Don't spam here.|
3. For more discussion (hints, ideas, solutions) please visit our forum.|
4. Authors are allowed to delete the post and use html code here (e.g. to provide some useful links).|



Last edit: 2022-03-03 12:12:27
2022-01-12 12:38:27
#include<bits/stdc++.h>
using namespace std;
main(){
int n,m,k,l;
k=0;
cin>>n;
m=n;
for(int i=1;i<=10000;i++){
if(n%i==0){
k++;
n=n/i;
if(n==1){
cout<<k;
return 0;
}
}else{
cout<<"No";
return 0;
}
}

}
2021-12-30 13:21:11
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int x=scanner.nextInt();
int y = 1;
int j = 1;
while (y < x) {
j++;
y=y*j;
}
if(y>x) {
y=y/j;
}
if( y == x) {
System.out.println(j);
} else {
System.out.println("NO");
}
}
}yagaad buruu bolchoj

Last edit: 2021-12-30 13:24:35
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
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.