Codeforces Round #169 (Div. 2) 276B - Little Girl and Game Solution




Problem Link: https://codeforces.com/contest/276/problem/B 

Solution in C++:

///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///Abul Hasnat  Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
#include <bits/stdc++.h>
using namespace std;
int a[50];
int main()
{
    string s;
    int i,c;
    cin>>s;
    for(int i=0; i<s.size(); ++i)
        a[s[i]-'a']++;
    c=0;
    for( i=0; i<26; ++i)
    {
        if(a[i]%2)
        {
            c++;
        }
    }
    if(c%2||c==0)
    {
        cout<<"First"<<endl;
        return 0;
    }
    cout<<"Second"<<endl;
    return 0;
}




 


No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h &g...

Powered by Blogger.