Submission #940845

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9408452024-03-07 18:34:30Maite_MoraleGroup Photo (JOI21_ho_t3)C++14
100 / 100
633 ms149588 KiB
#include<bits/stdc++.h>
#define F first
#define S second
#define MAX 5005
#define oo 1e18
#define mod 1000000007
#define fast_in ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout.setf(ios::fixed);cout.precision(0);
using namespace std;
typedef long long ll;
#define pll pair<ll , ll>
#define vll vector<ll>
#define vvll vector<vll>
#define vpll vector<pll>
struct ABI{
vll sum;
ABI(ll n){
sum.assign(n+10,0);
}
void update(ll a,ll b){
if(a<1 || a>=sum.size()){cout<<"anormalona";return;}
for(a;a<sum.size();a+=(a&-a))sum[a]+=b;
}
ll query(ll a){ll r=0;
if(a<1)return r;
a=min(a,(ll)sum.size()-1);
for(a;a>0;a-=(a&-a))r+=sum[a];
return r;
}
ll query(ll a,ll b){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In member function 'void ABI::update(ll, ll)':
Main.cpp:21:20: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |         if(a<1 || a>=sum.size()){cout<<"anormalona";return;}
      |                   ~^~~~~~~~~~~~
Main.cpp:22:13: warning: statement has no effect [-Wunused-value]
   22 |         for(a;a<sum.size();a+=(a&-a))sum[a]+=b;
      |             ^
Main.cpp:22:16: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |         for(a;a<sum.size();a+=(a&-a))sum[a]+=b;
      |               ~^~~~~~~~~~~
Main.cpp: In member function 'll ABI::query(ll)':
Main.cpp:27:13: warning: statement has no effect [-Wunused-value]
   27 |         for(a;a>0;a-=(a&-a))r+=sum[a];
      |             ^
#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...