Your task is to say if it is possible to obtain an array with an odd (not divisible by22 ) sum of elements. You have to answertt independent test cases. Input The first line of the input contains one integertt (1≤t≤20001≤t≤2000 ) — the number of test cases. The next2t2t l...
14 changes: 14 additions & 0 deletions 14 1296A-ArrayWithOddSum.cpp Original file line numberDiff line numberDiff line change @@ -0,0 +1,14 @@ #include <cstdio> int main(){ long t; scanf("%ld", &t); while(t--){ long n; scanf("%ld", &n); long cnt(0); for(long p ...
PracticeTwoPointersMethod2C-NumberOfSegmentsWithSmallSum.cpp PracticeTwoPointersMethod2D-NumberOfSegmentsWithBigSum.cpp PracticeTwoPointersMethod2E-SegmentsWithSmallSet.cpp PracticeTwoPointersMethod2F-SegmentsWithSmallSpread.cpp PracticeTwoPointersMethod3A-LoopedPlaylist.cpp README.mdBreadcrumbs CodeForces/...
n:7, a = 4 1 0 1 1 0 1 Output: 3 (split into 4, 1 0 ...) then continue with 1 0 1 1 0 1 and so on. My idea is to run a loop from l to r-1 check if sum(l,i) = sum(i+1,r) then i'll recursion to get the max But obviously, my solution isn't fast enough...