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