Submission #767922

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7679222023-06-27 09:35:34Dan4LifeTwo Currencies (JOI23_currencies)C++17
100 / 100
646 ms80084 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ar = array<ll,2>;
#define pb push_back
#define all(a) begin(a),end(a)
const int mxN = (int)1e5+10;
const int mxN2 = mxN*135;
const int mxLg = 17;
ar seg[mxN2];
int n, m, q, IND=1;
int jmp[mxLg][mxN];
vector<ar> adj[mxN];
vector<ll> v[mxN], w;
int L[mxN2], R[mxN2];
int lev[mxN], ro[mxN], orig[mxN*2];
int newChild(int p, int v){
int p2 = ++IND;
L[p2] = L[p], R[p2] = R[p];
seg[p2]={seg[p][0]+v,seg[p][1]+1};
return p2;
}
int newPar(int l, int r){
int p = ++IND; L[p] = l, R[p] = r;
for(int i : {0,1}) seg[p][i] = seg[l][i]+seg[r][i];
return p;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

currencies.cpp: In function 'void dfs(int, int)':
currencies.cpp:54:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   54 |         if(u==p) continue; ro[u] = ro[s];
      |         ^~
currencies.cpp:54:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   54 |         if(u==p) continue; ro[u] = ro[s];
      |                            ^~
currencies.cpp: In function 'int main()':
currencies.cpp:88:22: warning: range-based 'for' loops with initializer only available with '-std=c++2a' or '-std=gnu++2a'
   88 |     for(int cnt = 1; auto u : w) orig[cnt++]=u;
      |                      ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...