Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e62309b

Browse files
solved leetcode daily challenge, Three Divisors
1 parent 105651a commit e62309b

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

‎LeetCode/Three_Divisors/main.cxx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#include <bits/stdc++.h>
2+
#include <gtest/gtest.h>
3+
using namespace std;
4+
5+
6+
//// START
7+
/*
8+
## Three Divisors
9+
10+
*/
11+
12+
13+
class Solution {
14+
public:
15+
bool isThree(int n) {
16+
if (n <= 2) return false;
17+
int mi = sqrt(n);
18+
if (mi * mi != n) return false;
19+
for (int i = 2; i < mi; i++)
20+
if (n % i == 0) return false;
21+
return true;
22+
}
23+
};
24+
25+
//// END
26+
struct T {
27+
28+
};
29+
30+
TEST(Solution, test) {
31+
T ts[] = {
32+
{
33+
34+
},
35+
{
36+
37+
},
38+
39+
};
40+
41+
for (T t : ts) {
42+
Solution solution;
43+
44+
}
45+
}
46+
47+
int main() {
48+
testing::InitGoogleTest();
49+
50+
return RUN_ALL_TESTS();
51+
}
52+
53+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /