-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path399-coins.cpp
More file actions
56 lines (44 loc) · 1.2 KB
/
Copy path399-coins.cpp
File metadata and controls
56 lines (44 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Coins [47B]
* Problem: https://codeforces.com/problemset/problem/47/B
* Verdict: ACCEPTED Solved: 2020-12-31
* Language: C++17 (GCC 7-32)
* Runtime: 62 ms Memory: 0 KB
* Tags: implementation
* Author: BidoTeima
* Source: https://codeforces.com/contest/47/submission/102912289
*/
#include<bits/stdc++.h>
using namespace std;
int cnt=0,x;
vector<string> v;
int main()
{
map<char,int> mp;
mp.insert(pair<char, int>('A',0));
mp.insert(pair<char, int>('B',0));
mp.insert(pair<char, int>('C',0));
string s;
cin>>s;
if(s[1]=='>')mp[s[0]]++;
else mp[s[2]]++;
cin>>s;
if(s[1]=='>')mp[s[0]]++;
else mp[s[2]]++;
cin>>s;
if(s[1]=='>')mp[s[0]]++;
else mp[s[2]]++;
if(mp['A']==1&&mp['B']==1&&mp['C']==1)
cout<<"Impossible";
else{
if(mp['A']==0)cout<<"A";
else if(mp['B']==0)cout<<"B";
else if(mp['C']==0)cout<<"C";
if(mp['A']==1)cout<<"A";
else if(mp['B']==1)cout<<"B";
else if(mp['C']==1)cout<<"C";
if(mp['A']==2)cout<<"A";
else if(mp['B']==2)cout<<"B";
else if(mp['C']==2)cout<<"C";}
return 0;
}