Skip to content

Commit

Permalink
Add 14696.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Jan 6, 2024
1 parent d9d6115 commit c5b95cd
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions 14xxx/14696.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <iostream>
#include <vector>
using namespace std;

vector<int> input(void) {
int n; cin >> n;
vector<int> v(n);
for (int i=0; i<n; i++) cin >> v[i];

vector<int> ret(5, 0);
for (int i=0; i<n; i++) ret[v[i]]++;
return ret;
}

char solve(void) {
vector<int> a = input();
vector<int> b = input();

for (int i=4; i>=1; i--) {
if (a[i] != b[i]) return a[i] > b[i] ? 'A' : 'B';
}
return 'D';
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);

int n; cin >> n;
while (n--) cout << solve() << "\n";
return 0;
}

0 comments on commit c5b95cd

Please sign in to comment.