Submission #1014744

# Submission time Handle Problem Language Result Execution time Memory
1014744 2024-07-05T12:31:07 Z saayan007 Watering can (POI13_kon) C++17
70 / 100
4000 ms 9656 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]; */
    for(int i = a; i <= b; ++i) ++d[i];
}

int dojrzale(int a, int b)
{
    ++b, ++a;
    int ret = 0;
    for(int i = a; i <= b; ++i) ret += (d[i] >= k);
    return ret;
    /* 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); */
    /*     } */
    /* } */
    /* return ans[b] - ans[a - 1]; */
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1372 KB Output is correct
2 Correct 1 ms 1372 KB Output is correct
3 Correct 1 ms 1372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1624 KB Output is correct
2 Correct 2 ms 1612 KB Output is correct
3 Correct 1 ms 1372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 176 ms 3408 KB Output is correct
2 Correct 288 ms 3152 KB Output is correct
3 Correct 132 ms 3476 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 304 ms 3920 KB Output is correct
2 Correct 679 ms 4048 KB Output is correct
3 Correct 326 ms 4172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 899 ms 5200 KB Output is correct
2 Correct 1000 ms 5044 KB Output is correct
3 Correct 761 ms 5456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2752 ms 8276 KB Output is correct
2 Correct 1914 ms 7128 KB Output is correct
3 Correct 1735 ms 7852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3017 ms 9180 KB Output is correct
2 Correct 2599 ms 7760 KB Output is correct
3 Correct 2819 ms 9656 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 4043 ms 8436 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4034 ms 8624 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4058 ms 6696 KB Time limit exceeded
2 Halted 0 ms 0 KB -