Submission #924783

#TimeUsernameProblemLanguageResultExecution timeMemory
924783IUA_HasinBuilding 4 (JOI20_building4)C++17
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> #define endl "\n" #define finp for(int i=0; i<n; i++) #define fknp for(int k=0; k<n; k++) #define yeap cout<<"YES"<<endl #define nope cout<<"NO"<<endl #define inpintn int n; cin>>n #define inpintarrn int arr[n]; for(int i=0; i<n; i++){cin>>arr[i];} #define inpllarrn long long arr[n]; for(int i=0; i<n; i++){cin>>arr[i];} #define ll long long #define pb push_back #define answer cout<<ans<<endl #define INF (ll)(1e18) using namespace std; int main () { ll n; cin>>n; ll arr[2*n]; ll brr[2*n]; for(int i=0; i<2*n; i++){ cin>>arr[i]; } for(int i=0; i<2*n; i++){ cin>>brr[i]; } ll aa = 2*n; sort(arr, arr+aa); sort(brr, brr+aa); ll a = 0; ll b = 0; for(int i=0; i<2*n; i++){ if(a>=n){ cout<<"B"; b++; // cout<<brr[b]<<endl; } else if(b>=n){ cout<<"A"; a++; // cout<<arr[a]<<endl; } else { if(arr[a]<brr[b]){ cout<<"A"; a++; // cout<<arr[a]<<endl; } else { cout<<"B"; b++; // cout<<brr[b]<<endl; } } } // cout<<endl; // for(int i=0; i<2*n; i++){ // cout << arr[i] << " "; // } // cout<<endl; // for(int i=0; i<2*n; i++){ // cout << brr[i] << " "; // } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...