답안 #3446

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
3446 2013-08-31T05:51:00 Z mjy0503 Great Pow! (kriii1_G) C++
0 / 1
0 ms 1100 KB
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <vector>
#include <math.h>
int n;
int main(){
	int m,c;
	scanf("%d %d",&n,&m);
	if(m==0 || n==1)
		printf("%d\n",n);
	else{
		int i;
		c=sqrt((double)n);
		for(i=2;i<=c;i++){
			if(n%i==0) break;
		}
		if(i==c+1 && n!=2)
			printf("%d\n",n);
		else
			printf("1\n");
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1100 KB Output is correct
2 Correct 0 ms 1100 KB Output is correct
3 Correct 0 ms 1100 KB Output is correct
4 Correct 0 ms 1100 KB Output is correct
5 Incorrect 0 ms 1100 KB Output isn't correct
6 Halted 0 ms 0 KB -