-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (26 loc) · 726 Bytes
/
Copy pathmain.cpp
File metadata and controls
29 lines (26 loc) · 726 Bytes
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
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
constexpr bool DEBUG = false;
constexpr double TIME_LIMIT = 1800;
namespace timer {
constexpr double time_scale = 1.0;
// return in ms
int get_time(bool reset = false) {
static auto st = chrono::steady_clock::now();
if (reset) {
st = chrono::steady_clock::now();
return 0;
} else {
auto en = chrono::steady_clock::now();
int elapsed = (int)chrono::duration_cast<chrono::milliseconds>(en - st).count();
return (int)round(elapsed / time_scale);
}
}
} // namespace timer
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
timer::get_time(true);
}