Codeforces Round #377 (Div. 2)
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std; int main()
{
int k, r, i;
scanf("%d %d", &k, &r); for(i = 1; i < 10000; ++i)
{
if((i*k)%10 == r)
break;
else if((i*k) % 10 == 0){
break;
}
} printf("%d\n", i);
return 0;
} #include <stdio.h>
#include <string.h>
#include <iostream> using namespace std; int main()
{
int n, k;
int ai[510]; scanf("%d %d", &n, &k);
int i;
for(i = 0; i < n; ++i)
scanf("%d", (ai+i)); int sum = 0;
for(i = 0; i < n-1; ++i)
{
int n_sum = ai[i] + ai[i+1];
if(n_sum < k)
{
sum += k - n_sum;
ai[i+1] += k - n_sum;
}
}
printf("%d\n", sum);
for(i = 0; i < n; ++i)
printf("%d ", ai[i]);
return 0;
} #include <stdio.h>
#include <iostream>
#include <algorithm>
using namespace std; int main()
{
long long ans[3] = {0}, an = 0;
long long m[3];
int tag = 0;
for(int i = 0; i < 3; ++i)
{
cin >> m[i];
if(i > 0 && m[tag] < m[i])
{
tag = i;
}
} m[tag] -= 1; for(int i = 0; i < 3; ++i)
{
if(i != tag)
{
ans[i] = m[tag] - m[i];
if(ans[i] > 0)
an += ans[i];
}
} return 0;
}
CF DIV.2 变成6题,前两道有点水。。
Codeforces Round #377 (Div. 2)的更多相关文章
- Codeforces Round #377 (Div. 2) D. Exams
Codeforces Round #377 (Div. 2) D. Exams 题意:给你n个考试科目编号1~n以及他们所需要的复习时间ai;(复习时间不一定要连续的,可以分开,只要复习够ai天 ...
- Codeforces Round #377 (Div. 2)D(二分)
题目链接:http://codeforces.com/contest/732/problem/D 题意: 在m天中要考k个课程, 数组a中有m个元素,表示第a[i]表示第i天可以进行哪门考试,若a[i ...
- Codeforces Round #377 (Div. 2) E. Sockets
http://codeforces.com/contest/732/problem/E 题目说得很清楚,每个电脑去插一个插座,然后要刚好的,电脑的power和sockets的值相同才行. 如果不同,还 ...
- Codeforces Round #377 (Div. 2) D. Exams 贪心 + 简单模拟
http://codeforces.com/contest/732/problem/D 这题我发现很多人用二分答案,但是是不用的. 我们统计一个数值all表示要准备考试的所有日子和.+m(这些时间用来 ...
- Codeforces Round #377 (Div. 2) 被坑了
http://codeforces.com/contest/732/problem/B 题目要求任意两个连续的日子都要 >= k 那么如果a[1] + a[2] < k,就要把a[2]加上 ...
- Codeforces Round #377 (Div. 2)A,B,C,D【二分】
PS:这一场真的是上分场,只要手速快就行.然而在自己做的时候不用翻译软件,看题非常吃力非常慢,还有给队友讲D题如何判断的时候又犯了一个毛病,一定要心平气和,比赛也要保证,不要用翻译软件做题: Code ...
- Codeforces Round #377 (Div. 2) B. Cormen — The Best Friend Of a Man(贪心)
传送门 Description Recently a dog was bought for Polycarp. The dog's name is Cormen. Now Polycarp has ...
- Codeforces Round #377 (Div. 2) D. Exams(二分答案)
D. Exams Problem Description: Vasiliy has an exam period which will continue for n days. He has to p ...
- Codeforces Round #377 (Div. 2) C. Sanatorium 水题
C. Sanatorium time limit per test 1 second memory limit per test 256 megabytes input standard input ...
随机推荐
- Linux学习之四--Nginx
关于Nginx的 nginx的是一个高性能的Web服务器的软件.它比Apache HTTP服务器更加灵活,重量轻的程序. 本教程将教你如何安装和你的CentOS 7服务器上启动Nginx的. 先决 ...
- codeblocks16.01 中配置Opencv3 姿势
VS太大安装时间长,考虑到效率问题,可以使用opencv+codeblocks opencv3没有codeblocks版本,需要自己编译,编译过程略. 已编译版本下载地址 http://pan.bai ...
- 用SQL SERVER取分组数据第一条:查出每个班级的成绩第一名
create table test (id int, name ), score int, classname )); ,,'一班'); ,,'一班'); ,,'一班'); ,,'二班'); ,,'二 ...
- XUT 1245
这是一道2016湘潭邀请赛的题目,记得那个时候看到这个题目就想到了最短生成树,然后给别人做,WA了,最后发现是有向图,然后我自己去写了个搜索,结果是RE吧 今天刚刚好想到这个题目,然后再来做,发现这个 ...
- C# webBrowser控件禁用alert,confirm之类的弹窗解决方案
同样的代码,我尝试了很多次都没有成功.最后终于成功了,是因为我没有在正确的事件里面调用这段代码. private void InjectAlertBlocker() { HtmlElement hea ...
- DL论文
题目:Accurate Image Super-Resolution Using Very Deep Convolutional Networks(2016CVPR) 摘要:文中提出了一种高精度处理单 ...
- 【webGL】插件的使用的,实现一个鼠标动画的盒子
准备工作: 1.stat.js stat.js是Three.js的作者Mr. Doob的另一个有用的JavaScript库.很多情况下,我们希望知道实时的FPS信息,从而更好地监测动画效果.这时候,s ...
- LINUX下YUM源配置
转自:http://www.cnblogs.com/phoebus0501/archive/2010/12/14/1906144.html 1.确保RHEL5中已经安装了yum [root@lvs-m ...
- 用DllImport引用的外部DLL文件如何通过clickonce发布
在.net中非托管代码或非COM组件的外部DLL文件只能用DllImport的方式使用,但是在clickonce方式发布时不会自动包含到发布清单中去,办法是在项目中先把外部DLL文件作为普通文件添加进 ...
- mysql workbench连接不上远程数据库,xshell无法连接远程主机的问题
1.先说xshell无法连接的问题 最近使用virtualbox装了个ubuntu-16.04,然后在win7上使用xshell连接,首先确认win7能ping通虚拟机ip.然后确认是否安装了open ...