Created
September 20, 2021 07:30
-
-
Save vmpyr/83f5b105ab0b37da2cd93bffed1c800c to your computer and use it in GitHub Desktop.
1573-B
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() { | |
int t, temp; | |
cin >> t; | |
int n[t], ans[t]; | |
int a[t][100000], b[t][100000]; | |
for (int i = 0; i < t; i++) { | |
cin >> n[i]; | |
for (int j = 0; j<n[i]; j++) { | |
cin>>a[i][j]; | |
} | |
for (int j = 0; j<n[i]; j++) { | |
cin>>b[i][j]; | |
} | |
} | |
for (int i=1; i<t;) { | |
temp = n[i]; | |
for (int j=0; j<n[i];) { | |
for (int k=0; k<temp;){ | |
if (a[i][j] < b[i][k]) { | |
ans[i] = j + k; | |
break; | |
} | |
} | |
temp = ans[i] - j; | |
if (temp < 0) break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment