Submission #368059

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3680592021-02-19 12:03:15arnold518Specijacija (COCI20_specijacija)C++14
0 / 110
4093 ms155772 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 5e5;
int N, Q, T;
ll A[MAXN+10];
struct BIT
{
int tree[MAXN+10];
void update(int i, int k)
{
for(; i<=N+1; i+=(i&-i))
{
tree[i]+=k;
}
}
int query(int i)
{
int ret=0;
for(; i>0; i-=(i&-i))
{
ret+=tree[i];
}
return ret;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In member function 'void SEG::update(int, int, int, int, int, pii)':
Main.cpp:49:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   49 |   int mid=tl+tr>>1;
      |           ~~^~~
Main.cpp: In member function 'void SEG::init(int, int, int)':
Main.cpp:57:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   57 |   int mid=tl+tr>>1;
      |           ~~^~~
Main.cpp: In member function 'int SEG::query(int, int, int, int, int)':
Main.cpp:65:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   65 |   int mid=tl+tr>>1;
      |           ~~^~~
Main.cpp: In member function 'int SEG::query2(int, int, int, int, int)':
Main.cpp:78:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   78 |   int mid=tl+tr>>1;
      |           ~~^~~
Main.cpp: In function 'int level(ll)':
Main.cpp:89:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   89 |   int mid=lo+hi>>1;
      |           ~~^~~
Main.cpp: In function 'int getv(ll)':
Main.cpp:113:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  113 |   int mid=lo+hi>>1;
      |           ~~^~~
Main.cpp: In function 'int main()':
Main.cpp:142:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  142 |    int mid=lo+hi>>1;
      |            ~~^~~
Main.cpp:151:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  151 |    int mid=lo+hi>>1;
      |            ~~^~~
Main.cpp:126:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  126 |  scanf("%d%d%d", &N, &Q, &T);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~
Main.cpp:127:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  127 |  for(int i=1; i<=N; i++) scanf("%lld", &A[i]);
      |                          ~~~~~^~~~~~~~~~~~~~~
Main.cpp:193:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  193 |   scanf("%lld%lld", &u, &v);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...