题目大意:
  给你三个灯,分别以k1秒一次,k2秒一次和k3秒一次的频率闪烁着。
  你可以自定义三个灯开启的时间,问是否有一种方案,使得max(k1,k2,k3)秒之后,每秒钟都至少有一盏灯闪烁。

思路:
  很显然,当三盏灯频率都大于4秒一次时,不存在答案,那么我们只需要大力讨论4秒以内的情况即可。

 #include<cstdio>
#include<cctype>
#include<algorithm>
inline int getint() {
register char ch;
while(!isdigit(ch=getchar()));
register int x=ch^'';
while(isdigit(ch=getchar())) x=(((x<<)+x)<<)+(ch^'');
return x;
}
int main() {
int k1=getint(),k2=getint(),k3=getint();
if(k1>k2) std::swap(k1,k2);
if(k2>k3) std::swap(k2,k3);
if(k1>k2) std::swap(k1,k2);
if(k1==||k2<=||k1==&&k2==&&k3==||k1==&&k2==&&k3==) {
puts("YES");
return ;
}
puts("NO");
return ;
}

[CF911C]Three Garlands的更多相关文章

  1. Codeforces 707E Garlands

    Garlands 我怎么感觉好水啊. 因为询问只有2000组, 离线询问, 枚举联通块再枚举询问, 二维树状数组更新答案. #include<bits/stdc++.h> #define ...

  2. Codeforces Round #368 (Div. 2) E. Garlands 二维树状数组 暴力

    E. Garlands 题目连接: http://www.codeforces.com/contest/707/problem/E Description Like all children, Ale ...

  3. Three Garlands~Educational Codeforces Round 35

    C. Three Garlands time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...

  4. Garlands

    题意: n个数分成m段,每段偶数个数,最小化和最大段的半个区间的数字和. 分析: 先想到了二分,dp求能分成的最小段数. #include <map> #include <set&g ...

  5. Codeforces 707 E. Garlands (二维树状数组)

    题目链接:http://codeforces.com/problemset/problem/707/E 给你nxm的网格,有k条链,每条链上有len个节点,每个节点有一个值. 有q个操作,操作ask问 ...

  6. CF368 E - Garlands

    主席树 其实暴力二维树状还更快 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int M ...

  7. Garlands CodeForces - 707E (离线树状数组)

    大意: 给定n*m矩阵, k条链, 链上每个点有权值, 每次操作可以关闭或打开一条链或询问一个子矩阵内未关闭的权值和. 关键询问操作比较少, 可以枚举每条链, 暴力算出该条链对每个询问的贡献. 最后再 ...

  8. 【codeforces 707E】Garlands

    [题目链接]:http://codeforces.com/contest/707/problem/E [题意] 给你一个n*m的方阵; 里面有k个联通块; 这k个联通块,每个连通块里面都是灯; 给你q ...

  9. CF #368 div2

    题目链接:http://codeforces.com/contest/707/problem/A A. Brain's Photos time limit per test 2 seconds mem ...

随机推荐

  1. 使用记事本创建Web服务(WebService)

    学习就要从最简单最直观的地方入手. 1)打开记事本,添加如下代码: <%@ WebService Language="C#" Class="myFirstWebSe ...

  2. Jquery 获取checkbox的checked问题以及解决方案

    转载自:http://www.cnblogs.com/-run/archive/2011/11/16/2251250.html 这个郁闷了,今天写这个功能的时候发现了问题,上网找了好多资料对照,更加纠 ...

  3. shell编程---变量赋值

    echo $filen | awk -F. '{print $3}'  怎么把上边这行脚本产生的字串赋给一个变量啊,实际上会产生一个数, 这个变量用来存这个数.格式应该是怎么写的? a=`echo $ ...

  4. Spring学习-- IOC 容器中 bean 的生命周期

    Spring IOC 容器可以管理 bean 的生命周期 , Spring 允许在 bean 声明周期的特定点执行定制的任务. Spring IOC 容器对 bean 的生命周期进行管理的过程: 通过 ...

  5. Sencha Touch MVC 中 store 的使用

    I have a UserStore that I want to load after succesful login of a user. I can't get this to work i.e ...

  6. Spring MVC 参数校验

    转自:http://blog.csdn.net/eson_15/article/details/51725470 这一篇博文主要总结一下springmvc中对数据的校验.在实际中,通常使用较多是前端的 ...

  7. 转:java 帐号激活与忘记密码 实例

    原文链接:http://endual.iteye.com/blog/1613679 一.帐户激活   在 很多时候,在某些网站注册一个用户之后,网站会给这个用户注册时填写的email地址发送一封帐户激 ...

  8. 关于flume的几道题

    1,要求:监听一个tcp,udp端口41414将数据打印在控制台 # example.conf: A single-node Flume configuration # Name the compon ...

  9. DotNETCore 学习笔记 异常处理

    Error Handling public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseIISP ...

  10. 关于dlib人脸对比,人脸识别

    人脸检测 人脸特征点提取 人脸对比,等于两张人脸对比,识别 封装的所有识别函数,直接看下面调用就好了. # coding:utf-8 ''' 本本次封装,我主要是做两张人脸对比. 就只人脸识别部分,简 ...