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、的更多相关文章

  1. Educational Codeforces Round 11、A B题

    A. Co-prime Array 题意:给你一个数列,要求构造两两相邻之间的数互质的数列,可以插入的数的小于10的9次方 思路:其实可以选择靠近10的9次方的最大的三个素数.然后按我下面的方法做就可 ...

  2. Educational Codeforces Round 35 (Rated for Div. 2)

    Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...

  3. Educational Codeforces Round 63 (Rated for Div. 2) 题解

    Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...

  4. Educational Codeforces Round 58 (Rated for Div. 2) 题解

    Educational Codeforces Round 58 (Rated for Div. 2)  题目总链接:https://codeforces.com/contest/1101 A. Min ...

  5. Educational Codeforces Round 40千名记

    人生第二场codeforces.然而遇上了Education场这种东西 Educational Codeforces Round 40 下午先在家里睡了波觉,起来离开场还有10分钟. 但是突然想起来还 ...

  6. Educational Codeforces Round 69 (Rated for Div. 2) E. Culture Code

    Educational Codeforces Round 69 (Rated for Div. 2) E. Culture Code 题目链接 题意: 给出\(n\)个俄罗斯套娃,每个套娃都有一个\( ...

  7. Educational Codeforces Round 65 (Rated for Div. 2)题解

    Educational Codeforces Round 65 (Rated for Div. 2)题解 题目链接 A. Telephone Number 水题,代码如下: Code #include ...

  8. Educational Codeforces Round 64 (Rated for Div. 2)题解

    Educational Codeforces Round 64 (Rated for Div. 2)题解 题目链接 A. Inscribed Figures 水题,但是坑了很多人.需要注意以下就是正方 ...

  9. Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块

    Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块 [Problem Description] ​ ...

随机推荐

  1. Filter详解(转)

    以前以为Filter只是一个特殊点的Servlet,用进只需在web.xml中配置一下拦截路径就可以了,可经过这两天的深入学习,才知道以前对Filter类的了解和使用都太过浅薄了. 在网上看了很多篇相 ...

  2. Win7下IIS的安装配置与文件发布

    出于兴趣,抽空弄了一下Windows上的IIS,把过程记录下来与大家分享.高手请略过... 一.安装IIS.打开控制面板,单击“程序与功能” 二.点击左侧“打开或关闭Windows功能” 三.找到“I ...

  3. 软工作业———Alpha版本第二周小结

    姓名 学号 周前计划安排 每周实际工作记录 自我打分 zxl 061425 1.进行任务分配2.实现扫码和生成二维码功能 1.对主要任务进行了划分,但还为进行给模块间的联系2.完成了扫码签到功能 90 ...

  4. DateTimeFormatter

    //解析日期 String dateStr= "2018年12月18日"; DateTimeFormatter formatter = DateTimeFormatter.ofPa ...

  5. svn upgrade

    在我们把我们服务器上的svn 版本号升级以后,我们之前的代码再执行svn命令时,会提示需要执行svn upgrade命令把当前的代码由低版本的svn 上迁移到高版本的svn 上去. 直接执行svn u ...

  6. SPSS统计分析过程包括描述性统计、均值比较、一般线性模型、相关分析、回归分析、对数线性模型、聚类分析、数据简化、生存分析、时间序列分析、多重响应等几大类

    https://www.zhihu.com/topic/19582125/top-answershttps://wenku.baidu.com/search?word=spss&ie=utf- ...

  7. poj2987 最大权闭合图

    基础题. 最小割后,与汇点相连的点都不要,然后从源点出发dfs一遍有多少相连的点即可. #include<stdio.h> #include<string.h> #includ ...

  8. python 异常处理技巧

  9. Java练习 SDUT-2499_数字

    数字 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 定义f(x) = {比x小,不可以被x整除并且不和x互质的数的个数 ...

  10. 不撞南墙不回头———深度优先搜索(DFS)Oil Deposits

    Oil Deposits Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tota ...