Submission #735802

#TimeUsernameProblemLanguageResultExecution timeMemory
735802shadow_samiGame (APIO22_game)C++17
60 / 100
4035 ms25004 KiB
#include<bits/stdc++.h> #include "game.h" #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef int ll; typedef vector<ll> vi; typedef vector<vector<ll>> vvi; typedef pair<ll,ll> pi; typedef map<ll,ll> mi; typedef long double ld; typedef vector<ld> vd; typedef vector<vector<ld>> vvd; typedef pair<ld,ld> pd; #define ff first #define ss second #define srt(a) sort(a.begin(),a.end()); #define fip(k, n) for (ll i = k; i < n; i++) #define fjp(k, n) for (ll j = k; j < n; j++) #define fin(k, n) for (ll i = k; i >= n; i--) #define fjn(k, n) for (ll j = k; j >= n; j--) #define fp(k, n, m) for (ll k = n; k < m; k++) #define fn(k, n, m) for (ll k = n; k >= m; k--) #define ordered_set tree<pi, null_type,less< pi >, rb_tree_tag,tree_order_statistics_node_update> #define totalOne(n) __builtin_popcount(n) #define backZero(n) __builtin_ctzll(n) #define frontZero(n) __builtin_clzll(n) #define fx(k) for ( auto x : k ) #define test ll t;cin >> t;while (t--) #define nli "\n" ll n,m,tp,tp2,res,cnt,sum,tptp,ans; const ll mx = 3e5+5; const ll mod = 1e9+7; bool f = false; ll dp[mx]; vi adj[mx]; void init(ll aa,ll bb){ n = aa; fip(0,n) dp[i] = 1e9; m = bb; fip(1,m) adj[i].push_back(i-1); } void dfs(ll u){ ll pt = u < m ? u : dp[u]; fx(adj[u]){ if(dp[x] > pt){ dp[x] = pt; dfs(x); } } } ll add_teleporter(ll aa,ll bb){ adj[bb].push_back(aa); dfs(bb); fip(0,m) if(dp[i] <= i) return 1; return 0; }
#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...