#include"bits/stdc++.h" #include #include using namespace std; typedef long long int ll; #define all(v) (v).begin(),(v).end() #define pb push_back #define loop(i,a,n) for(int i = a; i < n; ++ i) #define rep(i,a,n) for(int i = a; i < =n; ++ i); //#define for(i,a,b) for(int i=(a);i<(b);++i) //#define rep(i,a,b) for(int =i;i<=(b);++i) #define trav(a, x) for (auto &a : (x)) void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __print(long long x) {cerr << x;} void __print(unsigned x) {cerr << x;} void __print(unsigned long x) {cerr << x;} void __print(unsigned long long x) {cerr << x;} void __print(float x) {cerr << x;} void __print(double x) {cerr << x;} void __print(long double x) {cerr << x;} void __print(char x) {cerr << '\'' << x << '\'';} void __print(const char *x) {cerr << '\"' << x << '\"';} void __print(const string &x) {cerr << '\"' << x << '\"';} void __print(bool x) {cerr << (x ? "true" : "false");} template void __print(const pair &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';} template void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";} template void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);} #define debug(x...) cerr << "[" << #x << "] = ["; _print(x) int mod=1e9+7; void local() { #ifndef ONLINE_JUDGE freopen("/Users/vaibhav/Documents/code /input.txt", "r",stdin); freopen("/Users/vaibhav/Documents/code /output.txt", "w", stdout); #endif } // first we have to evaluate the // distance from the top to the bottom consodering 1 as the tree node; int n,m,t; vectordep; map>>adj; void evaldepth(int src,int par){ for(auto child:adj[src]){ if(child.first!=par){ evaldepth(child.first,src); dep[src]=max(dep[src],child.second +dep[child.first]); } } } // vectorans(10); // void solve(int st,int par,int part){ // vectorprefix,suffix; // for(auto child :adj[st]){ // if(child.first!=par){ // prefix.push_back(dep[child.first]); // suffix.push_back(dep[child.first]); // } // // building the prefix and suffix array // for(int i=1; i<(int)prefix.size(); i++){ // prefix[i]=max(prefix[i-1],prefix[i]); // } // for(int i=(int)suffix.size()-2; i>=0;i--){ // suffix[i]=max(suffix[i],suffix[i+1]); // } // } // debug(prefix); // debug(suffix); // int childrens=0; // for(auto child:adj[st]) // { // if(child.first!=par){ // int op1=(childrens==0)?INT_MIN:prefix[childrens-1]; // int op2=(childrens==0)?INT_MIN:suffix[childrens-1]; // int parti=child.second+max(part,max(op1,op2)); // solve(child.first,st,parti); // childrens++; // } // } // ans[st]=1+max(part,(prefix.empty()?-1:prefix.back())); // } bool dis(string s){ setst; for(auto i:s){ st.insert(i); } if(st.size()==s.size()){ cout<&a) { int maxi=0; for(int i=0; i> trump; string c1, c2; cin >> c1 >> c2; unordered_map val({ {'6', 0}, {'7', 1}, {'8', 2}, {'9', 3}, {'T', 4}, {'J', 5}, {'Q', 6}, {'K', 7}, {'A', 8}, }); if (c1[1] == trump && c2[1] != trump) cout << "YES\n"; else if (c1[1] != trump && c2[1] == trump) cout << "NO\n"; else if (c1[1] == c2[1]) { if (val[c1[0]] > val[c2[0]]) cout << "YES\n"; else cout << "NO\n"; } else cout << "NO\n"; } int removezero(long long n){ string s=to_string(n); string a=""; for(char c:s){ if(c!='0'){ a+=c; } } return stoi(a); } ll po(ll n,ll k){ ll c=0; while(n!=0){ c++; n=n/k; } return c-1; } //vectorcost; //partial ans = maxprefix( from 1 to i-1),max suffix i+1 to k/// andans with 1+dep of pare int main() { local(); cout<<"Hello World!"; }