UVA 1636 Headshot

https://vjudge.net/problem/51197/origin

#include<bits/stdc++.h>
#include<stdio.h>
#include<iostream>
#include<cmath>
#include<math.h>
#include<queue>
#include<set>
#include<map>
#include<iomanip>
#include<algorithm>
#include<stack>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt","r",stdin);
#endif // ONLIN
    string s;
    int a,b;int n;int c;
    while(cin>>s)
    {
        n=s.size();
        a=0;b=0;c=0;
        for(int i=0;i<n;i++)
        {
            if(s[i]=='0'&&s[(i+1)%n]=='0')a++;
            if(s[i]=='0')b++;
            if(s[i]=='1')c++;
        }
        if(c==0){cout<<"EQUAL"<<endl;continue;}
        if(a*n==b*b){cout<<"EQUAL"<<endl;}
        else if(a*n>b*b){cout<<"SHOOT"<<endl;}
        else cout<<"ROTATE"<<endl;
    }
}

 

posted @ 2018-08-23 13:16  erge1998  阅读(94)  评论(0编辑  收藏  举报