Submission #731354

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7313542023-04-27 10:57:17ogibogi2004Holiday (IOI14_holiday)C++14
Compilation error
0 ms0 KiB
#include"holiday.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll MAXN=2e5+5e4+6;
const ll INF=2e9;
ll att[MAXN];
ll low[MAXN],high[MAXN],n1,start1,d1;
priority_queue<ll> pq;
ll cur_sum;
ll fr[MAXN],ansr[MAXN];
ll fl[MAXN],ansl[MAXN];
//start1 will be in left
ll what_to_check[MAXN];
struct node
{
ll cnt_cities;
ll sum;
};
struct segment_tree
{
node tree[3*MAXN];
void init()
{
for(ll j=0;j<4*MAXN;j++)
{
tree[j].cnt_cities=0;
tree[j].sum=0;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

holiday.cpp: In function 'long long int compute_right(long long int)':
holiday.cpp:104:1: warning: no return statement in function returning non-void [-Wreturn-type]
  104 | }
      | ^
holiday.cpp: In function 'long long int compute_left(long long int)':
holiday.cpp:152:1: warning: no return statement in function returning non-void [-Wreturn-type]
  152 | }
      | ^
holiday.cpp: In function 'long long int findMaxAttraction(long long int, long long int, long long int, long long int*)':
holiday.cpp:192:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  192 |     for(ll i=0;i<by_value.size();i++)
      |                ~^~~~~~~~~~~~~~~~
holiday.cpp: In function 'long long int compute_right(long long int)':
holiday.cpp:28:31: warning: iteration 750018 invokes undefined behavior [-Waggressive-loop-optimizations]
   28 |             tree[j].cnt_cities=0;
      |             ~~~~~~~~~~~~~~~~~~^~
holiday.cpp:26:21: note: within this loop
   26 |         for(ll j=0;j<4*MAXN;j++)
      |                    ~^~~~~~~
holiday.cpp: In function 'long long int compute_left(long long int)':
holiday.cpp:28:31: warning: iteration 750018 invokes undefined behavior [-Waggressive-loop-optimizations]
   28 |             tree[j].cnt_cities=0;
      |             ~~~~~~~~~~~~~~~~~~^~
holiday.cpp:26:21: note: within this loop
   26 |         for(ll j=0;j<4*MAXN;j++)
      |                    ~^~~~~~~
/usr/bin/ld: /tmp/ccuhh7uG.o: in function `main':
grader.cpp:(.text.startup+0xaf): undefined reference to `findMaxAttraction(int, int, int, int*)'
collect2: error: ld returned 1 exit status