Submission #1014745

#TimeUsernameProblemLanguageResultExecution timeMemory
1014745saayan007Watering can (POI13_kon)C++17
50 / 100
115 ms18512 KiB
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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...