-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchef_FACTORISZ.cpp
80 lines (55 loc) · 960 Bytes
/
chef_FACTORISZ.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include<stdio.h>
#include<iostream>
#include<time.h>
#include<stdlib.h>
using namespace std;
class timer {
private:
unsigned long begTime;
public:
void start() {
begTime = clock();
}
unsigned long elapsedTime() {
return ((unsigned long) clock() - begTime) ;
}
/*bool isTimeout(unsigned long seconds) {
return seconds >= elapsedTime();
}*/
};
int main()
{
int T,j=0; long long num,i,array[10000];
timer t;
cin>>T;
while(T--)
{
scanf("%lld",&num);
i=2;
for(i=2;i<=num/2;i++)
{
while(num%i==0)
{
num=num/i;
printf("%lld\n",i);
array[j]=i;j++;
//t=clock()-t;
//cout<<"\n time=====\n"<<t;
if(t.elapsedTime()>=2.88)
exit(0);
}
}
if(j>2)
{
for(int k=0;k<j-1;j++)
{
for(int g=k+1;g<j;g++)
{
long long temp=array[k]*array[g];
if(t.elapsedTime()>=2.88)
exit(0);
}
}
}
}
}