Created
March 23, 2016 19:50
-
-
Save HyeonWooKim/eac7b77766140ab455d1 to your computer and use it in GitHub Desktop.
유진수(BOJ 1356)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<string> | |
#include<vector> | |
#include<algorithm> | |
using namespace std; | |
int main() | |
{ | |
string a,b; | |
int len; | |
cin>>b; | |
len=b.length()-1; | |
for(int i=0;i<len;i++) | |
{ | |
a+=b[0]; | |
b.erase(b.begin()); | |
int ap=1,bp=1; | |
for(int j=0;j<a.length();j++)ap*=(a[j]-'0'); | |
for(int j=0;j<b.length();j++)bp*=(b[j]-'0'); | |
if(ap==bp) | |
{ | |
cout<<"YES\n"; | |
return 0; | |
} | |
} | |
cout<<"NO\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment