Submission #1111733

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11117332024-11-12 18:35:24zxciganFish 3 (JOI24_fish3)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(time(0));
using ll = long long;
#define int long long
const int N = 2e5 + 1;
void solve() {
int n, d; cin >> n >> d;
vector<int> c(n + 1), pref (n + 1);
for (int i = 1; i <= n; ++i) {
cin >> c[i];
pref[i] = pref[i - 1] + c[i];
}
int q; cin >> q;
vector<int> mxl (n + 1);
for (int i = 1; i <= n; ++i) {
if (c[i]) mxl[i] = mxl[i - 1] + 1;
}
while (q--) {
int l, r; cin >> l >> r;
int ans = 0;
while (r >= l) {
if (!a[r]) break;
r --;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:28:18: error: 'a' was not declared in this scope
   28 |             if (!a[r]) break;
      |                  ^
Main.cpp:32:17: error: 'a' was not declared in this scope
   32 |             if (a[r]) ans += 1;
      |                 ^