博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces Round #492 (Div. 2)
阅读量:4685 次
发布时间:2019-06-09

本文共 1778 字,大约阅读时间需要 5 分钟。

A.

/*从大往小依次除*/#include
#include
#include
#include
#include
#include
#define M#define ll long longusing namespace std;int read() { int nm = 0, f = 1; char c = getchar(); for(; !isdigit(c); c = getchar()) if(c == '-') f = -1; for(; isdigit(c); c = getchar()) nm = nm * 10 + c - '0'; return nm * f;}int main() { int n = read(), ans = 0; ans += n / 100; n %= 100; ans += n / 20; n %= 20; ans += n / 10; n %= 10; ans += n / 5; n %= 5; ans += n; cout << ans; return 0;}

B.

 

/*发现每个路口何时进去是能算出来的   所以O1扫一遍即可 */#include
#include
#include
#include
#include
#include
#define M 100010 #define ll long longusing namespace std;int read() { int nm = 0, f = 1; char c = getchar(); for(; !isdigit(c); c = getchar()) if(c == '-') f = -1; for(; isdigit(c); c = getchar()) nm = nm * 10 + c - '0'; return nm * f;}int note[M]; int main() { int n = read(), id, minn = 0x3e3e3e3e; for(int i = 1; i <= n; i++) { note[i] = read(); int op = note[i] - i + 1; int zz = (op + n - 1) / n; if(zz < minn) minn = zz, id = i; } cout << id; return 0;}

C.

 

 

 

D.

/*贪心的写法  每次 选择最靠左的一个不连续的  将右边的贪心移动过来 */#include
#include
#include
#include
#include
#include
#define M#define ll long longusing namespace std;int read() { int nm = 0, f = 1; char c = getchar(); for(; !isdigit(c); c = getchar()) if(c == '-') f = -1; for(; isdigit(c); c = getchar()) nm = nm * 10 + c - '0'; return nm * f;}int main() { return 0;}

 

转载于:https://www.cnblogs.com/luoyibujue/p/9290979.html

你可能感兴趣的文章
常用的匹配正则表达式和实例
查看>>
小组成员及其git链接
查看>>
SQL case when else
查看>>
MVc Identity登陆锁定
查看>>
cdn连接失败是什么意思_关于CDN的原理、术语和应用场景那些事
查看>>
ultraedit26 运行的是试用模式_免费试用U盘数据恢复工具 – 轻松找回U盘丢失的各种数据!...
查看>>
bootstrap table 收缩_bootstrap-table方法之:expandRow-collapseRow,展开或关闭当前行数据...
查看>>
mysql r_mysql:’r’是什么意思?
查看>>
python sum函数导入list_python sum函数iterable参数为二维list,start参数为“[]”该如何理解...
查看>>
mysql8单节点500m_Kubernetes 部署 Mysql 8.0 数据库(单节点)
查看>>
mysql数据工厂生产_MySQL超时与天蓝色数据工厂副本
查看>>
python缩进可以用在任何语句之后_每天一道Python选择题--python缩进
查看>>
微信小程序获取用户信息解密AES并且注意如何获取unionid
查看>>
JavaScript设计模式----1
查看>>
Qt实现半透明遮罩效果
查看>>
erlang调优方法
查看>>
Mysql linux -N命令
查看>>
daily scrum 12.5
查看>>
linux-ftp install
查看>>
NetXray
查看>>