Submission #259702

#TimeUsernameProblemLanguageResultExecution timeMemory
259702arnold518Snowy Roads (JOI16_snowy)C++14
35 / 100
19 ms2076 KiB
#include "Anyalib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; static const int MAXN = 500; static int N; static vector<pii> adj[MAXN+10]; static pii E[MAXN+10]; static int C[MAXN+10], A[MAXN+10]; void dfs(int now, int bef, int d) { A[now]=d; for(auto nxt : adj[now]) { if(nxt.first==bef) continue; dfs(nxt.first, now, d+C[nxt.second]); } } void InitAnya(int _N, int A[], int B[]) { N=_N; for(int i=1; i<N; i++) { int u=A[i-1]+1, v=B[i-1]+1; adj[u].push_back({v, i}); adj[v].push_back({u, i}); E[i]={u, v}; } } void Anya(int _C[]) { for(int i=2; i<=N; i++) C[i]=_C[i-2]; for(int i=1; i<=500; i++) { A[i]=A[i-1]+C[i]; if(i%10==0) { for(int j=0; j<9; j++) { int t=i/10-1; if(A[i]&(1<<j)) Save(t*9+j, 1); } } } for(int i=1; i<500; i++) if(C[i]) Save(i+449, 1); }
#include "Borislib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; static const int MAXN = 500; static int N; static vector<int> adj[MAXN+10]; static pii E[MAXN+10]; static int C[MAXN+10]; void InitBoris(int _N, int A[], int B[]) { N=_N; for(int i=1; i<N; i++) { int u=A[i-1]+1, v=B[i-1]+1; adj[u].push_back(v); adj[v].push_back(u); E[i]={u, v}; } } int Boris(int city) { int ret=0; city++; int t=city/10-1; if(t>=0) for(int i=0; i<9; i++) ret+=(Ask(i+t*9)<<i); for(int i=city/10*10+1; i<=city; i++) ret+=Ask(i+449); return ret; }

Compilation message (stderr)

Boris.cpp:14:12: warning: 'C' defined but not used [-Wunused-variable]
 static int C[MAXN+10];
            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...