Common discord group- discord.gg/P5TEZB4zAr (Beginners) The new coders- discord.gg/4DH3PWUX3t (Intermediate) Pro coders- discord.gg/H8TeFjvq6z
@OnlyAyushAgarwal7 ай бұрын
Nice
@natechen4 Жыл бұрын
lmao ur sacrificing the last 40 minutes of making a tutorial.🤣But great works btw! Came here with your comment and this helps a lot!
@Acodedaily Жыл бұрын
Haha. I always do this. Thanks for supporting
@aaravarya4406 Жыл бұрын
Initially I thought of the similar solution, but somewhere it wasn't working for me. Then I did it using difference array, it seemed more intuitive.
@huzaifaansari6195 Жыл бұрын
bro can you please share ur code that u did using difference array
@aaravarya4406 Жыл бұрын
@@huzaifaansari6195 I hope I ain't too late, here's the code. Maybe the code is Lil messy , if it's unclear to you plz let me know I can put down the approach. #include using namespace std; #define endl " " #define ll long long int #define vi vector #define KIT ios_base::sync_with_stdio(false),cin.tie(NULL) #define all(type) type.begin(), type.end() int32_t main() { KIT; int ttt; ttt=1; cin>>ttt; while(ttt--){ ll n; cin>>n; vector tea(n), tester(n); for(auto &x:tea)cin>>x; for(auto &x:tester)cin>>x; vi v(n+5,0), extra(n+5,0), prefix(n); prefix[0]=tester[0]; for(int i=1; i
@Everyday_smarter Жыл бұрын
hey i don't know what wrong with this approach 🥲 when i'm submitting it's showing wrong on fifth test case i can't find any mistake in code even i tried exactly code what u have shown in video it's not accepting my code : #include using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; vector a(n); vector b(n); for(int i=0; i>a[i]; for(int i=0; i>b[i]; long long used=0; multiset s; for(int i=0; i
@Acodedaily Жыл бұрын
overflow probably ... use long long instead of int
@Everyday_smarter Жыл бұрын
fine ! got the mistake ! i used int for set instead of long long