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 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.