Submission #398528

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3985282021-05-04 13:17:37model_codeArboras (RMI20_arboras)C++17
100 / 100
4265 ms19200 KiB
/**
* user: perju-verzotti-712
* fname: Luca
* lname: Perju-Verzotti
* task: Arboras
* score: 100.0
* date: 2020-12-04 11:29:29.204456
*/
#include <bits/stdc++.h>
using namespace std;
const long long mod=1000000007;
long long p[100003],t[100003],sz[100003],depth[100003],heavyhead[100003],heavychild[100003];
vector<long long>v[100003];
long long d[100003];
unsigned long long dp[100003],dp1[100003];
long long bstfiu[100003];
long long pzlin[100003];
long long cnttidk;
long long lsb (long long x)
{
return x&-x;
}
long long aib[100003];
void update (long long pz, long long val)
{
for(long long i=pz;i<=100000;i+=lsb(i))
aib[i]=aib[i]+val;
}
long long query (long long pz)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

arboras.cpp: In function 'void dfsinit(long long int)':
arboras.cpp:55:24: 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]
   55 |     for(long long i=0;i<v[pz].size();++i)
      |                       ~^~~~~~~~~~~~~
arboras.cpp: In function 'void dfsinit1(long long int)':
arboras.cpp:89:24: 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]
   89 |     for(long long i=0;i<v[pz].size();++i)
      |                       ~^~~~~~~~~~~~~
arboras.cpp: In function 'void dfsinit2(long long int)':
arboras.cpp:98:24: 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]
   98 |     for(long long i=0;i<v[pz].size();++i)
      |                       ~^~~~~~~~~~~~~
arboras.cpp: In function 'void jegupdate(long long int, long long int)':
arboras.cpp:151:26: warning: comparison of integer expressions of different signedness: 'long long int' and 'long long unsigned int' [-Wsign-compare]
  151 |             if(dpc+d[pzc]>dp1[ptc])
      |                ~~~~~~~~~~^~~~~~~~~
arboras.cpp: In function 'int main()':
arboras.cpp:163:19: warning: unused variable 'j' [-Wunused-variable]
  163 |     long long n,i,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...