# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
799224 |
2023-07-31T10:54:37 Z |
Blagoj |
Watering can (POI13_kon) |
C++17 |
|
3939 ms |
131072 KB |
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <string.h>
#include <bitset>
#include <numeric>
#include <utility>
#include<math.h>
using namespace std;
#define ll long long
const int nax = 300'001;
int sq = 1405;
int N, K, t[nax], zers[nax], ans[nax];
int mapa[220][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 |
1512 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 |
461 ms |
2056 KB |
Output is correct |
2 |
Correct |
512 ms |
2020 KB |
Output is correct |
3 |
Correct |
380 ms |
2048 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
717 ms |
2384 KB |
Output is correct |
2 |
Correct |
847 ms |
3576 KB |
Output is correct |
3 |
Correct |
689 ms |
1964 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1292 ms |
74584 KB |
Output is correct |
2 |
Correct |
911 ms |
57152 KB |
Output is correct |
3 |
Correct |
920 ms |
2636 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3163 ms |
109848 KB |
Output is correct |
2 |
Correct |
1742 ms |
71312 KB |
Output is correct |
3 |
Correct |
2099 ms |
8376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2379 ms |
103064 KB |
Output is correct |
2 |
Correct |
1997 ms |
122648 KB |
Output is correct |
3 |
Correct |
1892 ms |
10656 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
869 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3335 ms |
17564 KB |
Output is correct |
2 |
Correct |
2568 ms |
11028 KB |
Output is correct |
3 |
Correct |
3246 ms |
8604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3348 ms |
15656 KB |
Output is correct |
2 |
Correct |
2953 ms |
14584 KB |
Output is correct |
3 |
Correct |
3939 ms |
4900 KB |
Output is correct |