Submission #781162

#TimeUsernameProblemLanguageResultExecution timeMemory
781162tolbiGame (IOI13_game)C++17
37 / 100
13027 ms25464 KiB
#pragma optimize("Bismillahirrahmanirrahim") //█▀█─█──█──█▀█─█─█ //█▄█─█──█──█▄█─█■█ //█─█─█▄─█▄─█─█─█─█ //Allahuekber //ahmet23 orz... //FatihSultanMehmedHan //YavuzSultanSelimHan //AbdulhamidHan //Sani buyuk Osman Pasa Plevneden cikmam diyor #define author tolbi #include<bits/stdc++.h> using namespace std; template<typename X, typename Y> ostream& operator<<(ostream& os, pair<X,Y> pr){return os<<pr.first<<" "<<pr.second;} template<typename X> ostream& operator<<(ostream& os, vector<X> v){for (auto &it : v) os<<it; return os;} template<typename X, size_t Y> ostream& operator<<(ostream& os, array<X,Y> v){for (auto &it : v) os<<it; return os;} #define endl '\n' #define deci(x) int x;cin>>x; #define decstr(x) string x;cin>>x; #define vint(x) vector<int> x #define sortarr(x) sort(x.begin(), x.end()) #define sortrarr(x) sort(x.rbegin(), x.rend()) #define rev(x) reverse(x.begin(), x.end()) #define tol(bi) (1LL<<((long long)(bi))) #define coutarr(x) for (auto &it : x) cout<<it<<endl; typedef long long ll; const ll INF = LONG_LONG_MAX; const int MOD = 1e9+7; mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count()); #include "game.h" long long gcd2(long long X, long long Y) { long long tmp; while (X != Y && Y != 0) { tmp = X; X = Y; Y = tmp % Y; } return X; } struct SegTree{ vector<ll> segtree; SegTree(int n){ segtree.resize(tol(ceil(log2(n)+1))-1,0ll); } void update(int node, ll val){ node+=segtree.size()/2; segtree[node]=val; while (node){ node=(node-1)/2; segtree[node]=gcd2(segtree[node*2+1],segtree[node*2+2]); } } ll query(int tarl, int tarr, int l = 0, int r = -1, int node = 0){ if (r==-1) r = segtree.size()/2; if (l>=tarl && r<=tarr) return segtree[node]; if (l>tarr || r<tarl) return 0; int mid = l+(r-l)/2; ll lnode = query(tarl, tarr, l, mid, node*2+1); ll rnode = query(tarl, tarr, mid+1, r, node*2+2); return gcd2(lnode, rnode); } }; vector<SegTree> segtree; void init(int R, int C) { segtree.resize(R,SegTree(C)); } void update(int P, int Q, long long K) { segtree[P].update(Q,K); } long long calculate(int P, int Q, int U, int V) { ll res = 0; for (int i = P; i <= U; i++){ res=gcd2(res,segtree[i].query(Q,V)); } return res; }

Compilation message (stderr)

game.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...