-
Notifications
You must be signed in to change notification settings - Fork 67
/
AMR10C.cpp
63 lines (57 loc) · 1.13 KB
/
AMR10C.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
//
// main.cpp
// Dolphin
//
// Created by Mahmud on 20/05/17.
// Copyright © 2017 Mahmud. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <set>
#include <map>
//#include <unordered_map>
#include <utility>
#include <cassert>
#include <iomanip>
#include <ctime>
#include <sstream>
#include <istream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
const int me = 1000025;
int T, N;
int lp[me];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
for(int i = 2; i < me; i ++)
if(!lp[i]){
for(int j = i; j < me; j += i)
lp[j] = i;
}
cin >> T;
for(int _ = 0; _ < T; _ ++){
cin >> N;
int result = 0;
while(N > 1){
int d = lp[N];
int count = 0;
while(N % d == 0){
count ++;
N /= d;
}
result = max(result, count);
}
cout << result << endl;
}
return 0;
}