Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void)
{
    int deskA_book_num;
    int deskB_book_num;
    long long int required_time;
    long long int total_timeA = 0;
    long long int total_timeB = 0;
    cin >> deskA_book_num >> deskB_book_num >> required_time;

    vector<long long int> deskA_book_time(deskA_book_num);
    vector<long long int> deskB_book_time(deskB_book_num);

    //机Aの時間入力
    for(int i = 0; i < deskA_book_num; i++)
    {
        cin >> deskA_book_time[i];
    }
    //机Bの時間入力
    for(int i = 0; i < deskB_book_num; i++)
    {
        cin >> deskB_book_time[i];
    }

    long long int total_time = 0;
    int readable_books = 0;
    int bookA_top_idx = 0;
    int bookB_top_idx = 0;

    while(total_time < required_time)
    {
        //両方の机とも本がある
        if( (deskA_book_time.empty() != true) && (deskB_book_time.empty() != true) )
        {
            //机Aの方が時間が短い
            if (deskA_book_time[bookA_top_idx] <= deskB_book_time[bookB_top_idx] )
            {
                if( (deskA_book_time[bookA_top_idx] + total_time) <= required_time)
                {
                    readable_books++;
                    total_time += deskA_book_time[bookA_top_idx];
                    //cout << "deskA_book:" << deskA_book_time[0] << "read." << endl;
                    bookA_top_idx++;
                }
                else
                {
                    total_time += deskA_book_time[bookA_top_idx];
                    bookA_top_idx
                }
            }
            else
            {
                if( (deskB_book_time[bookB_top_idx] + total_time) <= required_time)
                {
                    readable_books++;
                    total_time += deskB_book_time[bookB_top_idx];
                    bookB_top_idx++;
                    //cout << "deskB_book:" << deskB_book_time[0] << "read." << endl;
                }
                else
                {
                    total_time += deskB_book_time[bookB_top_idx];
                    bookB_top_idx++;

                }
            }
        }       //deskAに本がない
        else if ( (deskA_book_time.empty() == true) && (deskB_book_time.empty() != true))
        {
                if( (deskB_book_time[bookB_top_idx] + total_time) <= required_time)
                {
                    readable_books++;
                    total_time += deskB_book_time[bookB_top_idx];
                    bookB_top_idx++;
                    //cout << "deskB_book:" << deskB_book_time[0] << "read." << endl;                    
                }
                else
                {
                    total_time += deskB_book_time[bookB_top_idx];
                    bookB_top_idx++;
                }
        }       //deskBに本がない
        else if( (deskA_book_time.empty() != true) && (deskB_book_time.empty() == true))
        {
                if( (deskA_book_time[bookA_top_idx] + total_time) <= required_time)
                {
                    readable_books++;
                    total_time += deskA_book_time[bookA_top_idx];
                    bookA_top_idx++;
                    //cout << "deskA_book:" << deskA_book_time[0] << "read." << endl;
                }
                else
                {
                    total_time += deskA_book_time[bookA_top_idx];
                    bookA_top_idx++;
                }
        }       //どちらの机にも本がない
        else if( (deskA_book_time.empty() == true) && (deskB_book_time.empty() == true))
        {
            break;
        }
    }
    cout << readable_books << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:34: error: expected ';' before '}' token
   52 |                     bookA_top_idx
      |                                  ^
      |                                  ;
   53 |                 }
      |                 ~