Я использую fstream для чтения некоторых файлов и выполнения с ними некоторых действий для решения проблем. В приложении вся программа: [code]#include #include #include #include #include #include #include using namespace std;
int main() { ifstream fin("exampleinput.txt"); ofstream fout("exampleoutput.txt"); long long tc_num = 0; long long tc_amount; fin >> tc_amount; for(int i = 0; i < tc_amount; i++) { long long len; fin >> len; vector height_list(len, -1); for(int j = 0; j < len; j++) { fin >> height_list[j]; }
long long max_dif = 0; sort(height_list.begin(), height_list.end()); vector better_heights(len, -1); int left = 0; int right = len - 1; bool Is_Left = true;