zoukankan      html  css  js  c++  java
  • 和風いろはちゃんイージー / 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 57 and 5 syllables, in this order.

    To create a Haiku, Iroha has come up with three different phrases. These phrases have AB 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

    Copy
    5 5 7
    

    Sample Output 1

    Copy
    YES
    

    Using three phrases of length 55 and 7, it is possible to construct a Haiku.


    Sample Input 2

    Copy
    7 7 5
    

    Sample Output 2

    Copy
    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 }
    View Code
  • 相关阅读:
    移动端常用单位——rem
    媒体查询media query
    canvas——绘制解锁图案
    canvas——离屏
    canvas——动画实例
    canvas绘制圆弧
    canvas二次贝塞尔&三次贝塞尔操作实例
    form表单中id与name的区别
    数据存储 mysql
    数据存储 csv
  • 原文地址:https://www.cnblogs.com/wydxry/p/7287043.html
Copyright © 2011-2022 走看看