Submission #839239

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8392392023-08-29 10:18:58starplatTwo Currencies (JOI23_currencies)C++14
10 / 100
3534 ms66052 KiB
#include <bits/stdc++.h>
#define f first
#define s second
#define int long long
using namespace std;
int n,m,q,u[100005],v[100005],road[100005],pos[400005];
int tin,in[200005],out[200005],lift[25][200005],szm,szq;
int l[100005],r[100005],gold[100005],sil[100005],vis[100005];
int frq[100005],bkfq[100005],sum[100005],ans[100005];
pair<int,int> ckpt[100005];
vector<pair<int,int> > grh[200005];
vector<int> st[100005];
pair<int,pair<int,int> > qry[100005];
void add(int x,int y,int w){
grh[x].push_back({y,w});
grh[y].push_back({x,w});
}
bool is(int x,int y){
return (in[x]<=in[y] && out[x]>=out[y]);
}
int lca(int x,int y){
if (is(x,y)) return x;
if (is(y,x)) return y;
for (int i=20;i>=0;i--){
if (lift[i][x] && !is(lift[i][x],y)) x=lift[i][x];
}
return lift[0][x];
}
void dfs(int x,int p){
in[x]=++tin; lift[0][x]=p;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

currencies.cpp: In function 'int main()':
currencies.cpp:77:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   77 |   for (int j=0;j<st[i].size()-1;j++) {
      |                ~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...