# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
799235 |
2023-07-31T10:59:30 Z |
Blagoj |
Watering can (POI13_kon) |
C++17 |
|
3596 ms |
131072 KB |
#include <iostream>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,unroll-loops")
using namespace std;
#define ll long long
const int nax = 300'001;
int sq = 1500;
int N, K, t[nax], zers[nax], ans[nax];
int mapa[190][300001];
void inicjuj(int n, int k, int *D)
{
//sq = min(550, (int)sqrt(n) + 1);
for (int i = 0; i < n; i++){
t[i] = D[i];
}
N = n, K = k;
for (int i = 0; i < n; i++){
if (K >= t[i] && K - t[i] <= 300000)
mapa[i / sq][-(K - t[i]) + 300000]++;
if (t[i] >= K)ans[i / sq]++;
}
}
void podlej(int a, int b)
{
//--a,--b;
int from = a/sq, to = (b / sq);
for (int i = from; i <= to; i++){
if (a <= i * sq && b >= (i + 1) * sq - 1){
zers[i]++;
ans[i] += mapa[i][300000 - zers[i]];
}else{
ans[i] = 0;
for (int j = i * sq; j / sq == i && j < N; j++){
if (K >= t[j] && K - t[j] <= 300000)
mapa[i][-(K - t[j]) + 300000]--;
t[j] += zers[i];
if (j >= a && j <= b)t[j]++;
if (K >= t[j] && K - t[j] <= 300000){
mapa[i][- (K - t[j]) + 300000]++;
}
if (t[j] >= K)ans[i]++;
}
zers[i] = 0;
}
}
}
int dojrzale(int a, int b)
{
// --a,--b;
int odg = 0;
int from = a/sq, to = (b / sq);
for (int i = from; i <= to; i++){
if (a <= i * sq && b >= (i + 1) * sq - 1){
odg += ans[i];
}else{
for (int j = max(a, i * sq); j / sq == i && j <= b; j++){
odg += (t[j] + zers[i] >= K);
}
}
}
return odg;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
1492 KB |
Output is correct |
2 |
Correct |
1 ms |
1492 KB |
Output is correct |
3 |
Correct |
1 ms |
1492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
1492 KB |
Output is correct |
2 |
Correct |
17 ms |
1528 KB |
Output is correct |
3 |
Correct |
1 ms |
1492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
490 ms |
2244 KB |
Output is correct |
2 |
Correct |
516 ms |
1904 KB |
Output is correct |
3 |
Correct |
421 ms |
2184 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
747 ms |
2520 KB |
Output is correct |
2 |
Correct |
901 ms |
3536 KB |
Output is correct |
3 |
Correct |
732 ms |
1996 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1498 ms |
70004 KB |
Output is correct |
2 |
Correct |
1002 ms |
53884 KB |
Output is correct |
3 |
Correct |
977 ms |
2564 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3596 ms |
97628 KB |
Output is correct |
2 |
Correct |
1895 ms |
62636 KB |
Output is correct |
3 |
Correct |
2238 ms |
2572 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2449 ms |
91560 KB |
Output is correct |
2 |
Correct |
2138 ms |
110868 KB |
Output is correct |
3 |
Correct |
2029 ms |
3792 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
905 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3532 ms |
17528 KB |
Output is correct |
2 |
Runtime error |
34 ms |
6200 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
33 ms |
5932 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |