和風いろはちゃんイージー / Iroha and Haiku (ABC Edition) (水水)
题目链接:http://abc042.contest.atcoder.jp/tasks/abc042_a
Time limit : 2sec / Memory limit : 256MB
Score : 100 points
Problem Statement
Iroha loves Haiku. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.
To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.
Constraints
- 1≦A,B,C≦10
Input
The input is given from Standard Input in the following format:
A B C
Output
If it is possible to construct a Haiku by using each of the phrases once, print YES
(case-sensitive). Otherwise, print NO
.
Sample Input 1
5 5 7
Sample Output 1
YES
Using three phrases of length 5, 5 and 7, it is possible to construct a Haiku.
Sample Input 2
7 7 5
Sample Output 2
NO
题解:看三个数的和是否能整除(5+5+7==14)
1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <cstdio> 5 #include <vector> 6 #include <cstdlib> 7 #include <iomanip> 8 #include <cmath> 9 #include <ctime> 10 #include <map> 11 #include <set> 12 #include <queue> 13 using namespace std; 14 #define lowbit(x) (x&(-x)) 15 #define max(x,y) (x>y?x:y) 16 #define min(x,y) (x<y?x:y) 17 #define MAX 100000000000000000 18 #define MOD 1000000007 19 #define pi acos(-1.0) 20 #define ei exp(1) 21 #define PI 3.141592653589793238462 22 #define INF 0x3f3f3f3f3f 23 #define mem(a) (memset(a,0,sizeof(a))) 24 typedef long long ll; 25 ll gcd(ll a,ll b){ 26 return b?gcd(b,a%b):a; 27 } 28 bool cmp(int x,int y) 29 { 30 return x>y; 31 } 32 const int N=10005; 33 const int mod=1e9+7; 34 int main() 35 { 36 std::ios::sync_with_stdio(false); 37 int a,b,c; 38 cin>>a>>b>>c; 39 if((a+b+c)%17==0) cout<<"YES"<<endl; 40 else cout<<"NO"<<endl; 41 return 0; 42 }