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
2020-07-17 16:57:57
import java.util.Scanner;

//Java program to remove punctuation from a given string

//Java code to illustrate different constructors and methods
//String class.

//Java program to demonstrate
//codePoints() method of IntStream class

import java.util.stream.IntStream;

public class GFG {
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k=n;
for(int i=1;;i++) {
if(n%i==0) {
n=n/i;
}
else
break;
}
if(n==1) {
System.out.println(k);
}else
System.out.println("NO");


}
}
2020-07-17 15:02:29
import java.util.*;
import java.lang.*;

class Main
{
public static void main (String[] args) throws java.lang.Exception
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 1;; i++) {
if (n % i == 0) {
n /= i;
} else {
break;
}
}
if (n == 1)
System.out.println("YES");
else
System.out.println("NO");

}
}
}
2020-05-19 17:27:38
#include <stdio.h>

int main(int argc, char** argv) {
int n, x, l, k=1;
scanf("%d", &n);
l=n/2;
for(int m=1;m<l;m++){
k=k*m;
x=m;
if(k==n){
printf("%d", x);
return 0;

}
}
printf("NO");


}bruu genuu ?????
2020-03-25 01:32:44
Bilgee
#include <stdio.h>
int main()
{
int s=1, n, m, i;
scanf("%d",&n);
for ( i=1;; i++){
s=s*i;
m=i;
if (s==n){ printf ("%d\n", m);
return 0;
} else if (s>n) {printf("No\n");
break;
}
}
}
2020-03-02 06:26:51
#include<stdio.h>

int main() {
int n, a=1;
scanf("%d", &n);
for(int i=1; true; i++) {
a=a*i;
if(n==a) {
printf("%d", n);
break;
} else if(a>n) {
printf("No");
break;
}
}
return 0;
}
zuv l hiisen baimaar yum daaaa????????
2020-01-17 06:46:47
h
2020-01-17 06:44:21
plz tell me
2020-01-16 05:41:08
#include <iostream>
using namespace std;
int main(){
int n,i=1,a=1,j=1;
cin >> n;
while(a>0){
if(n==i) a--;
else{
i=i*j;
j++;
}
}
cout << j-1;
}
2019-12-06 08:25:56
fy
2019-12-04 09:30:38
fy
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.