online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n,k,tmp,r; vector<int> a,b; cin >> n; for (int q1234 = 0; q1234 < n; q1234++){ cin >> k; r = 0; for (int i = 0;i < k;i++){ cin >> tmp; a.push_back(tmp); } for (int i = 0;i < k;i++){ cin >> tmp; b.push_back(tmp); } sort(a.begin(),a.end()); sort(b.begin(),b.end()); reverse(a.begin(),a.end()); for (int j =0;j<k;j++){ r+=max(a[j],b[j]); } cout << r << endl; a.clear(); b.clear(); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue