# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
484607 | asandikci | Utrka (COCI14_utrka) | C++17 | 1 ms | 204 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
Aliberk Sandıkçı
3 November 2021
Current Rank: Newbie
Current Grade: 10th in Izmir Science High School
*/
#include "bits/stdc++.h"
#define pb push_back
#define lwb lower_bound
#define upb upper_bound
#define fi first
#define se second
#define debu cout << "*debug*\n"
#define debug(x) cout << "debug " << x <<"\n"
#define int long long
constexpr int modn = 1e9+7; // 998244353
constexpr int maxn = 1e6+5;
constexpr int INF = 1e9+5;
using namespace std;
map<string,int> mp1;
map<string,int> mp2;
vector<string> vec;
void solve(){
int n;
cin >> n;
string str;
for(int i=0;i<n;i++){
cin >> str;
mp1[str]++;
}
for(int i=0;i<n-1;i++){
cin >> str;
vec.pb(str);
mp2[str]++;
}
for(auto it : vec){
if(mp1[it]==0){
cout << it;
return;
}
else if(mp2[it]!=mp1[it]){
cout << it ;
return;
}
}
cout << mp1.rbegin()->first;
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
//freopen("","r",stdin);
//freopen("","w",stdout);
int T=1;
//cin >> T;
while(T--){
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |