问题类型:有意思的数学公式
03pie’s solution for [HDU-3788]
#include<iostream>
#include<cctype>
#include<cstring>using namespace std;int main() {string s;while(cin>>s){int a=0,b=0,c=s.size()-1;for(int i=0;i<s.size();i++){if(s[i]=='z') a=i;if(s[i]=='j') b=i;}int ok=1;if(c+1<3) ok=0;c=c-b; b=b-a-1; a=a-0;if(c==a*b&&ok&&b) printf("Accepted\n");else printf("Wrong Answer\n");}return 0;
}