• 和風いろはちゃんイージー / 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
  • 相关阅读:
    龟兔赛跑(多线程练习题)
    进程和线程详解
    toString()方法详解
    使用IDEA的Git插件上传项目教程
    js运算符单竖杠“|”的用法和作用及js数据处理
    vue项目axios请求接口,后端代理请求接口404,问题出现在哪?
    jQuery的ajax的post请求json格式无法上传空数组
    es6 学习小记 扩展运算符 三个点(...)
    select2插件使用小记2
    js中多维数组转一维
  • 原文地址:https://www.cnblogs.com/shixinzei/p/7287043.html
Copyright © 2020-2023  润新知