Submission #1014744

#TimeUsernameProblemLanguageResultExecution timeMemory
1014744saayan007Watering can (POI13_kon)C++17
70 / 100
4058 ms9656 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]; */ 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 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...