Submission #1014745

# Submission time Handle Problem Language Result Execution time Memory
1014745 2024-07-05T12:36:29 Z saayan007 Watering can (POI13_kon) C++17
50 / 100
115 ms 18512 KB
using namespace std;
const int mxn = 3e5 + 10;
int diff[mxn];
int n, k;
int d[mxn];
int ans[mxn] = {};
bool comp = 0;

void inicjuj(int N, int K, int *D)
{
    n = N, k = K;
    for(int i = 0; i < N; ++i) {
        d[i + 1] = D[i];
    }
}

void podlej(int a, int b)
{
    ++b, ++a;
    ++diff[a], --diff[b + 1];
}

int dojrzale(int a, int b)
{
    ++b, ++a;
    if(!comp) {
        for(int i = 1; i <= n; ++i) {
            diff[i] += diff[i - 1];
            d[i] += diff[i];
            ans[i] = ans[i - 1] + (d[i] >= k ? 1 : 0);
        }
        comp = 1;
    }
    return ans[b] - ans[a - 1];
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1372 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1372 KB Output is correct
2 Correct 1 ms 1628 KB Output is correct
3 Correct 1 ms 1372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 2140 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 18 ms 2140 KB Output is correct
2 Correct 19 ms 2140 KB Output is correct
3 Correct 17 ms 2100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 2908 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 50 ms 3668 KB Output is correct
2 Correct 55 ms 3348 KB Output is correct
3 Correct 43 ms 2860 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 62 ms 3920 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 72 ms 7148 KB Output is correct
2 Correct 71 ms 12368 KB Output is correct
3 Correct 89 ms 15444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 115 ms 11324 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 105 ms 10292 KB Output is correct
2 Correct 101 ms 18512 KB Output is correct
3 Correct 99 ms 17600 KB Output is correct