CF 4A Watermelon(水??!!)

Watermelon

Time Limit: 1000ms

Memory Limit: 65536KB

This problem will be judged on CodeForces.
Original ID: 4A

64-bit integer IO format: %I64d     
Java class name: (Any)

Prev

Submit Status Statistics Discuss

Next

Type:

None

None Graph Theory 
    2-SAT     Articulation/Bridge/Biconnected Component
     Cycles/Topological Sorting/Strongly Connected Component
     Shortest Path 
        Bellman Ford         Dijkstra/Floyd Warshall
     Euler Trail/Circuit 
    Heavy-Light Decomposition     Minimum Spanning Tree
     Stable Marriage Problem 
    Trees     Directed Minimum Spanning Tree
     Flow/Matching 
        Graph Matching             Bipartite Matching
             Hopcroft–Karp Bipartite Matching
             Weighted Bipartite Matching/Hungarian Algorithm
         Flow 
            Max Flow/Min Cut             Min Cost Max Flow
 DFS-like 
    Backtracking with Pruning/Branch and Bound 
    Basic Recursion     IDA* Search 
    Parsing/Grammar     Breadth First Search/Depth First Search
     Advanced Search Techniques 
        Binary Search/Bisection         Ternary Search
 Geometry 
    Basic Geometry     Computational Geometry
     Convex Hull 
    Pick‘s Theorem Game Theory 
    Green Hackenbush/Colon Principle/Fusion Principle 
    Nim     Sprague-Grundy Number 
Matrix     Gaussian Elimination 
    Matrix Exponentiation Data Structures 
    Basic Data Structures     Binary Indexed Tree
     Binary Search Tree 
    Hashing     Orthogonal Range Search 
    Range Minimum Query/Lowest Common Ancestor 
    Segment Tree/Interval Tree     Trie Tree
     Sorting 
    Disjoint Set String 
    Aho Corasick     Knuth-Morris-Pratt 
    Suffix Array/Suffix Tree Math 
    Basic Math     Big Integer Arithmetic 
    Number Theory         Chinese Remainder Theorem
         Extended Euclid 
        Inclusion/Exclusion         Modular Arithmetic
     Combinatorics 
        Group Theory/Burnside‘s lemma         Counting
     Probability/Expected Value 
Others     Tricky 
    Hardest     Unusual 
    Brute Force     Implementation 
    Constructive Algorithms     Two Pointer 
    Bitmask     Beginner 
    Discrete Logarithm/Shank‘s Baby-step Giant-step Algorithm 
    Greedy     Divide and Conquer 
Dynamic Programming                  
Tag it!

One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos.
They rushed home, dying of thirst, and decided to divide the berry, however they faced a hard problem.

Pete and Billy are great fans of even numbers, that‘s why they want to divide the watermelon in such a way that each of the two parts weighs even number of kilos, at the same time it is not obligatory that the parts
are equal. The boys are extremely tired and want to start their meal as soon as possible, that‘s why you should help them and find out, if they can divide the watermelon in the way they want. For sure, each of them should get a part of positive weight.

Input

The first (and the only) input line contains integer number w (1?≤?w?≤?100)
— the weight of the watermelon bought by the boys.

Output

Print YES, if the boys can divide the watermelon into two parts, each of them weighing even number of kilos; and NO in
the opposite case.

Sample Input

Input

8

Output

YES

Hint

For example, the boys can divide the watermelon into two parts of 2 and 6 kilos respectively (another variant — two parts of 4 and 4 kilos).

Source

Codeforces Beta Round #4 (Div. 2 Only)

题意:

两个人平均分一个西瓜,得到的必需是整数!

首先,要能平分相同的偶数,则原来必需为偶数,且要大于2

AC代码:

#include <iostream>
using namespace std;
int main()
{
    int n;
    while(cin>>n)
    {
        if(n>2&&n%2==0)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}
时间: 2024-11-04 14:36:04

CF 4A Watermelon(水??!!)的相关文章

codeforces 4A Watermelon

题目链接:http://codeforces.com/problemset/problem/4/A 题目大意:给出一个数,问是否能分为不为零的两个偶数 判断是否为偶数即可,并且因为不能为0,所以2不成立 #include<bits/stdc++.h>using namespace std;int n;int main(){ scanf("%d",&n); if(n==2||(n&1))printf("NO\n"); else printf

AES advanced encryption standard 3

This optimized <../aesbench/> AES implementation conforms to FIPS-197. aes.h #ifndef _AES_H #define _AES_H #ifndef uint8 #define uint8 unsigned char #endif #ifndef uint32 #define uint32 unsigned long int #endif typedef struct { uint32 erk[64]; /* en

openssl创建CA、申请证书及其给web服务颁发证书

一.创建私有的CA   1)查看openssl的配置文件:/etc/pki/tls/openssl.cnf   2)创建所需的文件 touch /etc/pki/CA/index.txt   echo 01 >/etc/pki/CA/serial 3)CA自签证书生成私钥 cd /etc/pki/CA (umask 066;openssl genrsa -out /etc/pki/CA/private/cakey.pem 2048) 4)生成自签名证书 openssl req -new -x50

Codeforces初体验

Codeforces印象 这两天抽时间去codeforces体验了一把. 首先,果然有众多大牛存在,很多名人一直参加每周一次的比赛,积分2000+,并参与出题. 另外,上面题目很多,估计至少一千题.比赛结束后,题目将转为练习题,可以持续尝试.每道题目都有标签,如greedy, math, matrices等等,可以点击相应的标签只做相关的题目.可惜我做了好几道之后才发现. 这次解决的题目 首次尝试,这次做的几个都是选的完成人数最多的,比较简单,但还是有些东西是从中新学习到的.以后最好分类练习.

2017-4-16-Train:Codeforces Beta Round #4 (Div. 2 Only)

反思: 我去确实很菜啊,写不动数据结构,写不动trick题,脑子转不动. 可能一直在写专题,都是不需要思考用什么方法的题目,所以都没有经过太多的思考.就像今天的DIV2.实话真的简单,但是我只有一题1A,其中B题没读到题目细节,还有D题没想到DP去做,而是直接写模拟了.唉,说多了都是泪,加油训练吧 A. Watermelon(水题) One hot summer day Pete and his friend Billy decided to buy a watermelon. They cho

「6月雅礼集训 2017 Day10」perm(CodeForces 698F)

[题目大意] 给出一个$n$个数的序列$\{a_n\}$,其中有些地方的数为0,要求你把这个序列填成一个1到$n$的排列,使得: $(a_i, a_j) = 1$,当且仅当$(i, j) = 1$.多组数据. $n \leq 3\times 10^5, T\leq 10$ CodeForces:无多组数据,$n \leq 10^6$ [题解] 这题有点神奇啊.. 首先考虑序列全是0要怎么做. 考虑到如果两个数的位置含有的因数种类完全一样,那么它们是可以互换的.(这个挺显然的) 观察如果两个质数的

CAS 5.x搭建常见问题系列(2).PKIX path building failed

错误原因 服务端的证书是不安全的,Cas的客户端在调用时因为安全提醒造成调用失败. CAS的客户端需要导入服务端的证书后,就正常了. 具体操作步骤如下: 1. 首先启动tomcat,看下之前搭建的cas server启动是否正常 双击D:\casoverlay\apache-tomcat-8.5.31\bin\startup.bat 访问 https://cas.example.org:8443/cas/login 如对对cas的搭建有疑问,可看文章<轻松搭建CAS 5.x系列文章> ·2.

Test on 11/17/2018

第一次参加cf比赛,水了一发写了三道水题实在不想写了,然后Rating就低了,好难过哈哈哈哈. cf#521(div.3) D:Cutting Out Description You are given an array ss consisting of nn integers. You have to find any array tt of length kk such that you can cut out maximum number of copies of array tt fro

OpenSSL(1)密钥和证书管理

OpenSSL是一个开源项目,包括密码库和SSL/TLS工具集. 从项目的官方站点可以看到: OpenSSL项目是安全套接字层( secure sockets layer, SSL)和传输层安全( transport layer security, TLS)协议的一个实现,是大家共同努力开发出的代码可靠.功能齐全.商业级别的开源工具集.项目由遍布世界的志愿者所组成的社区进行管理,他们通过互联网进行沟通.计划和开发OpenSSL工具集以及相关的文档. OpenSSL在这一领域已经成为事实上的标准,