Submission #232247

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2322472020-05-16 13:59:47smilu2244Holiday (IOI14_holiday)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_N = 101010;
const int MAX_SEG = MAX_N*4;
struct Seg {
ll sum[MAX_SEG];
int cnt[MAX_SEG];
void clear() {
memset(sum, 0x00, sizeof(sum));
memset(cnt, 0x00, sizeof(cnt));
}
void update(int n, int s, int e, int x, ll val) {
if (x < s || x > e) return;
if (s == e) {
if (val >= 0) {
sum[n] = val;
cnt[n] = 1;
} else {
sum[n] = cnt[n] = 0;
}
} else {
int m = (s + e) >> 1, l = n << 1, r = l | 1;
if (x <= m) update(l, s, m, x, val);
else update(r, m+1, e, x, val);
sum[n] = sum[l] + sum[r];
cnt[n] = cnt[l] + cnt[r];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

holiday.cpp: In function 'll solve(int, int, int, ll*)':
holiday.cpp:126:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int rt = 0; rt < R_max.size(); rt++) {
                    ~~~^~~~~~~~~~~~~~
holiday.cpp: In instantiation of 'std::vector<int> build_ranks(const std::vector<_Tp>&) [with T = long long int]':
holiday.cpp:92:47:   required from here
holiday.cpp:53:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < arr.size(); i++) {
holiday.cpp:58:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < arr.size(); i++) {
holiday.cpp: In function 'int main()':
holiday.cpp:141:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d%d", &n, &start, &d);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
holiday.cpp:142:37: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   for (int i = 1; i <= n; i++) scanf("%lld", &ps[i]);
                                ~~~~~^~~~~~~~~~~~~~~~
/tmp/ccbJrA7h.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cczKnaV6.o:holiday.cpp:(.text.startup+0x0): first defined here
/tmp/ccbJrA7h.o: In function `main':
grader.cpp:(.text.startup+0x89): undefined reference to `findMaxAttraction(int, int, int, int*)'
collect2: error: ld returned 1 exit status