| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1329118 | alinur | Secret (JOI14_secret) | C++17 | 341 ms | 4428 KiB |
#include "secret.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll a[1001], pref[1001], b[1001];
ll mod = 1e9;
void Init(int N, int A[]) {
int n = N;
pref[0] = 0;
for (int i = 1; i <= n; i++) a[i] = A[i - 1], b[i] = a[i] % 2, a[i] -= a[i] % 2, pref[i] = pref[i - 1] + a[i];
}
int Query(int L, int R) {
L++, R++;
ll x = pref[R] - pref[L - 1] + b[L];
x %= mod;
if (x == 0) x = mod;
return x;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
