Educational Codeforces Round 7、
A - Infinite Sequence
题意:有一种这样的无限序列数 1,1,2,1,2,3..... (如果最大数n,那么就有从1到n的所有1到n的数);
思路:题意只给了1秒、直接模拟肯定超时,我用的是二分找下界
#include<iostream>
using namespace std;
long long f(long long x)
{
return (+x)*x/;
}
long long search(long long x)
{
int l,r,m;
l=;r=1e8;
while(l<=r){
m=(l+r)/;
if(f(m)>=x) r=m-;
else l=m+;
}
return l;
}
int main()
{
long long n;
while(cin >> n){
long long ans;
ans=search(n);
ans=n-f(ans-);
cout << ans << endl;
}
}
#include<stdio.h>
int main()
{
long long int n,i,k;
scanf("%lld",&n);
i=;
k=n;
while(k>i)
{
k-=i;
i++;
}
printf("%lld",k);
return ;
}
B - The Time
题意:给一个时间给你,然后给你个分钟时间给你,让你相加
思路:直接模拟算
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int a,b;
while(~scanf("%d%*c%d%*c",&a,&b)){
int c;scanf("%d",&c);
int ans=c/;
int cns=c%;
ans+=(cns+b)/;
ans+=a;
cns=(cns+b)%;
ans=ans%;
printf("%02d:%02d\n",ans,cns);
}
}
Educational Codeforces Round 7、的更多相关文章
- Educational Codeforces Round 11、A B题
A. Co-prime Array 题意:给你一个数列,要求构造两两相邻之间的数互质的数列,可以插入的数的小于10的9次方 思路:其实可以选择靠近10的9次方的最大的三个素数.然后按我下面的方法做就可 ...
- Educational Codeforces Round 35 (Rated for Div. 2)
Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...
- Educational Codeforces Round 63 (Rated for Div. 2) 题解
Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...
- Educational Codeforces Round 58 (Rated for Div. 2) 题解
Educational Codeforces Round 58 (Rated for Div. 2) 题目总链接:https://codeforces.com/contest/1101 A. Min ...
- Educational Codeforces Round 40千名记
人生第二场codeforces.然而遇上了Education场这种东西 Educational Codeforces Round 40 下午先在家里睡了波觉,起来离开场还有10分钟. 但是突然想起来还 ...
- Educational Codeforces Round 69 (Rated for Div. 2) E. Culture Code
Educational Codeforces Round 69 (Rated for Div. 2) E. Culture Code 题目链接 题意: 给出\(n\)个俄罗斯套娃,每个套娃都有一个\( ...
- Educational Codeforces Round 65 (Rated for Div. 2)题解
Educational Codeforces Round 65 (Rated for Div. 2)题解 题目链接 A. Telephone Number 水题,代码如下: Code #include ...
- Educational Codeforces Round 64 (Rated for Div. 2)题解
Educational Codeforces Round 64 (Rated for Div. 2)题解 题目链接 A. Inscribed Figures 水题,但是坑了很多人.需要注意以下就是正方 ...
- Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块
Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块 [Problem Description] ...
随机推荐
- Swift 之 函数与闭包的应用实例
http://www.cocoachina.com/swift/20160106/14862.html 今天的博客算是比较基础的,还是那句话,基础这东西在什么时候都是最重要的.说到函数,只要是写过程序 ...
- NOIP模拟 17.8.16
NOIP模拟17.8.16 A 债务文件名 输入文件 输出文件 时间限制 空间限制debt.pas/c/cpp debt.in debt.out 1s 128MB[题目描述]小 G 有一群好朋友,他们 ...
- 调试R代码中出现的常用的函数
1. 字符串连接函数 paste的一般使用格式为: paste(..., sep = " ", collapse = NULL) ...表示一个或多个R可以被转化为字符型的对象:s ...
- 本地 vs. 云:大数据厮杀的最终幸存者会是谁?— InfoQ专访阿里云智能通用计算平台负责人关涛
摘要: 本地大数据服务是否进入消失倒计时?云平台大数据服务最终到底会趋向多云.混合云还是单一公有云?集群规模增大,上云成本将难以承受是误区还是事实?InfoQ 将就上述问题对阿里云智能通用计算平台负责 ...
- svn upgrade
在我们把我们服务器上的svn 版本号升级以后,我们之前的代码再执行svn命令时,会提示需要执行svn upgrade命令把当前的代码由低版本的svn 上迁移到高版本的svn 上去. 直接执行svn u ...
- N!分解素因子及若干问题【转载】
这里写的非常好http://www.cnblogs.com/openorz/archive/2011/11/14/2248992.html,感谢博主,我这里就直接用了. 将N!表示成 N! = p1^ ...
- Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十一章:模板测试
原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十一章:模板测试 代码工程地址: https://github.co ...
- Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二章:矩阵代数
原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第二章:矩阵代数 学习目标: 理解矩阵和与它相关的运算: 理解矩阵的乘 ...
- git操作——git pull 撤销误操作,恢复本地代码
需求 开发的代码还未commit到git本地仓库,就从git远程仓库上pull了代码,导致开发的代码直接被冲掉,需要退回到上一个版本代码. 操作 进入到项目git本地仓库文件夹下 打开cmd窗口,执行 ...
- cocos2d-x游戏开发(十五)游戏载入动画loading界面
这个资源载入的loading界面demo是在玩客网做逆转三国的时候随手写的,尽管我在那仅仅待了2个礼拜.可是也算參与了一个商业游戏项目了,学到不少东西.当时使用的cocos2d-x还是1.0版的,我用 ...