Submission #544528

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5445282022-04-02 08:41:54iulia13Synchronization (JOI13_synchronization)C++14
30 / 100
579 ms40308 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int LG = 20;
vector <int> g[N];
int dad[N][LG];
map <int, int> id[N];
int lvl[N], in[N], out[N], timp, card[N], inters[N], aib[N], n;
int lsb(int x)
{
return x & (-x);
}
void upd(int x, int val)
{
for (x; x <= n; x += lsb(x))
aib[x] += val;
}
int qry(int x)
{
int ans = 0;
for (x; x; x -= lsb(x))
ans += aib[x];
return ans;
}
void lifting() ///used
{
for (int j = 1; (1 << j) <= n; j++)
for (int i = 1; i <= n; i++)
dad[i][j] = dad[dad[i][j - 1]][j - 1];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

synchronization.cpp: In function 'void upd(int, int)':
synchronization.cpp:16:10: warning: statement has no effect [-Wunused-value]
   16 |     for (x; x <= n; x += lsb(x))
      |          ^
synchronization.cpp: In function 'int qry(int)':
synchronization.cpp:22:10: warning: statement has no effect [-Wunused-value]
   22 |     for (x; x; x -= lsb(x))
      |          ^
#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...