Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
mytemp
#include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> #define forn(ii, a, b) for (int ii = (int)a; ii < (int)b; ii++) #define scan(any) for (auto &i : any) cin >> i; #define debug(x) cerr << #x << " $$$ " << x << " -- \n" #define int64 long long #define sized(x) (int)x.size() #define all(x) (x).begin(), (x).end() #define precise(x) cout << fixed << setprecision(12) << x << '\n'; using namespace std; using namespace __gnu_pbds; template <class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; struct compare{ bool operator()(pair <int,int> A, pair <int,int> B) { int l1 = A.second-A.first; int l2 = B.second-B.first; if(l1 == l2) return A.first < B.first; return l1 > l2; } }; class SegmentTree{ int n; vector <int> tree; public: SegmentTree(vector <int> given){ n = sized(given); tree.resize(2*n,0); for(int i = n ; i < n+n ; i++) tree[i] = given[i-n]; for(int i = n-1 ; ~i ; i--) tree[i] = tree[i<<1] + tree[i<<1|1]; } SegmentTree(int N){ n = N; tree.resize(2*n,0); } void modify(int posn , int value){ for(tree[posn+=n] += value ; posn > 1 ; posn >>= 1) tree[posn>>1] = tree[posn] + tree[posn^1]; } int query (int l, int r){ int best = 0; for( l += n , r += n ; l < r ; l>>=1, r>>=1){ if(l&1) best = best+tree[l++]; if(r&1) best = best+tree[--r]; } return best; } }; class fenwickTree{ int n; vector <int> tree; public: fenwickTree(vector <int> a){ n = sized(a); tree.resize(n,0); } fenwickTree(int n){ this->n = n; tree.resize(n,0); } void add(int idx, int delta) { for ( ++idx; idx <= n; idx += idx & -idx) tree[idx] += delta; } int sum(int r) { int ret = 0; for ( ++r ; r > 0; r -= r & -r) ret += tree[r]; return ret; } }; int evaluate(){ return 0; } int32_t main(){ ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); auto start = chrono::steady_clock::now(); int cases = 1; cin >> cases; forn(_,0,cases) evaluate(); auto finish = chrono::steady_clock::now(); auto elapsed_ms = chrono::duration_cast<chrono::milliseconds>(finish - start); cerr << endl << "Time: " << elapsed_ms.count() << " ms\n"; return 0LL; }
run
|
edit
|
history
|
help
0
Finding Ocean
Reverse a string
MergeSort
scemo dd
Anagrams
introduction c-types
On Off
ForwardListString2
Ploshtina na pravoagolnik
Привет Linux