-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXXboilerplate.cpp
More file actions
41 lines (36 loc) · 1.03 KB
/
XXboilerplate.cpp
File metadata and controls
41 lines (36 loc) · 1.03 KB
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
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <unordered_map>
#include <iomanip>
#include <chrono>
#include <unordered_set>
using namespace std;
class Solution
{
public:
std::vector<bool> kidsWithCandies(std::vector<int> &candies, int extraCandies)
{
return {};
}
};
int main()
{
auto start = std::chrono::high_resolution_clock::now();
Solution s;
std::vector<int> candies{2, 3, 5, 1, 3};
int extraCandies = 3;
std::vector<bool> res = s.kidsWithCandies(candies, extraCandies);
// std::cout << res << std::endl;
copy(res.begin(), res.end(), std::ostream_iterator<int>(std::cout, "\n"));
// Timer
auto end = std::chrono::high_resolution_clock::now();
double time_taken =
std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count();
time_taken *= 1e-9;
std::cout << "Time taken by program is : " << std::fixed
<< time_taken << std::setprecision(9);
std::cout << " sec" << std::endl;
return 0;
}