horses.cpp:1:4: warning: character constant too long for its type
1 | You're absolutely right, and I apologize for that oversight. You've pointed out a crucial issue: we need to find the true maximum before applying the modulo operation. This is a great catch.
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
horses.cpp:2:179: warning: missing terminating ' character
2 | To solve this problem correctly while avoiding overflow, we can use a technique called "modular exponentiation" combined with maintaining the logarithm of our current value. Here's an improved approach:
| ^
horses.cpp:2:179: error: missing terminating ' character
2 | To solve this problem correctly while avoiding overflow, we can use a technique called "modular exponentiation" combined with maintaining the logarithm of our current value. Here's an improved approach:
| ^~~~~~~~~~~~~~~~~~~~~~~~
horses.cpp:3:8: error: stray '#' in program
3 | cppCopy#include <bits/stdc++.h>
| ^
horses.cpp:1:1: error: 'You' does not name a type
1 | You're absolutely right, and I apologize for that oversight. You've pointed out a crucial issue: we need to find the true maximum before applying the modulo operation. This is a great catch.
| ^~~
horses.cpp: In function 'int calc_max_profit()':
horses.cpp:26:5: error: 'vector' was not declared in this scope
26 | vector<long long> log_horses(N_store + 1, 0);
| ^~~~~~
horses.cpp:5:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
4 | #include "horses.h"
+++ |+#include <vector>
5 | using namespace std;
horses.cpp:26:12: error: expected primary-expression before 'long'
26 | vector<long long> log_horses(N_store + 1, 0);
| ^~~~
horses.cpp:30:20: error: 'log_horses' was not declared in this scope
30 | if (i > 0) log_horses[i] = log_horses[i-1];
| ^~~~~~~~~~
horses.cpp:31:9: error: 'log_horses' was not declared in this scope
31 | log_horses[i] += log2l(X_store[i]);
| ^~~~~~~~~~
horses.cpp:31:26: error: 'log2l' was not declared in this scope
31 | log_horses[i] += log2l(X_store[i]);
| ^~~~~
horses.cpp:33:26: error: 'max' was not declared in this scope
33 | max_log_profit = max(max_log_profit, log_profit);
| ^~~
horses.cpp:38:19: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
38 | return pow_mod(base, exp);
| ~~~~~~~^~~~~~~~~~~