Problem C | Tea tasting | codeforces educational round 143

Поделиться
HTML-код
  • Опубликовано: 9 ноя 2024

Комментарии • 10

  • @Acodedaily
    @Acodedaily  Год назад +3

    Common discord group- discord.gg/P5TEZB4zAr
    (Beginners) The new coders- discord.gg/4DH3PWUX3t
    (Intermediate) Pro coders- discord.gg/H8TeFjvq6z

  • @OnlyAyushAgarwal
    @OnlyAyushAgarwal 7 месяцев назад +1

    Nice

  • @natechen4
    @natechen4 Год назад +5

    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
      @Acodedaily  Год назад +2

      Haha. I always do this. Thanks for supporting

  • @aaravarya4406
    @aaravarya4406 Год назад +4

    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
      @huzaifaansari6195 Год назад

      bro can you please share ur code that u did using difference array

    • @aaravarya4406
      @aaravarya4406 Год назад +1

      @@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
    @Everyday_smarter Год назад +2

    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
      @Acodedaily  Год назад

      overflow probably ... use long long instead of int

    • @Everyday_smarter
      @Everyday_smarter Год назад +1

      fine ! got the mistake ! i used int for set instead of long long