Submission #1036494

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10364942024-07-27 13:00:44AndreyLine Town (CCO23_day1problem3)C++14
25 / 25
580 ms333752 KiB
#include<bits/stdc++.h>
using namespace std;
vector<long long> idk(500001);
vector<long long> lol(500001);
vector<long long> no(500001);
vector<pair<long long,long long>> roll(0);
void reset() {
for(int i = (int)roll.size()-1; i >= 0; i--) {
lol[roll[i].second] = roll[i].first;
}
roll.clear();
}
void upd2(long long a, long long x) {
while(a < lol.size()) {
roll.push_back({lol[a],a});
lol[a]+=x;
a+=(a&(-a));
}
}
long long calc2(long long a) {
long long c = 0,sb = 0;
for(long long i = 19; i >= 0; i--) {
if(c+(1 << i) <= a) {
c+=(1 << i);
sb+=lol[c];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'void upd2(long long int, long long int)':
Main.cpp:17:13: 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]
   17 |     while(a < lol.size()) {
      |           ~~^~~~~~~~~~~~
Main.cpp: In function 'std::pair<long long int, long long int> dude(long long int, std::vector<long long int>&, std::vector<long long int>&, long long int)':
Main.cpp:50:19: 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]
   50 |             if(y1 >= haha.size()) {
      |                ~~~^~~~~~~~~~~~~~
Main.cpp:57:19: 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]
   57 |             if(y2 >= bruh.size()) {
      |                ~~~^~~~~~~~~~~~~~
Main.cpp:96:23: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   96 |     while(idk1.size() <= s+1) {
      |           ~~~~~~~~~~~~^~~~~~
Main.cpp:99:23: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   99 |     while(idk2.size() <= s+1) {
      |           ~~~~~~~~~~~~^~~~~~
Main.cpp:104:46: 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]
  104 |             if(idk1[i].first+idk2[s-i].first == haha.size() && idk1[i].second+idk2[s-i].second == bruh.size()) {
Main.cpp:104:96: 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]
  104 |             if(idk1[i].first+idk2[s-i].first == haha.size() && idk1[i].second+idk2[s-i].second == bruh.size()) {
Main.cpp: In function 'void upd(long long int, long long int)':
Main.cpp:118:13: 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]
  118 |     while(a < idk.size()) {
      |           ~~^~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...