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] ...
随机推荐
- Java 分页对象
以前一直没有自己写过分页对象,自己模仿着写了一个分页对象,写完之后感觉也是挺简单的 package com.css.util; import java.io.Serializable;import j ...
- 【风马一族_php】NO5_php基础知识_数组
原文来自:http://www.cnblogs.com/sows/p/6032570.html (博客园的)风马一族 侵犯版本,后果自负 回顾 匿名函数 定义: 变量 = function [参数列表 ...
- Windows10 +Ubuntu 18.04双系统安装详细教程
前言: 由于开发需要,很多用户需要安装Linux环境.如果用虚拟机操作会消耗大量内存,一般的电脑会显得卡顿,从而影响开发效率.这里分享一些安装经验,希望能够帮助大家. 教程: 步骤1:下载镜像文件 从 ...
- CodePlus2017 12月月赛 div2火锅盛宴
当时看到这道题感觉真是难过,我数据结构太弱啦. 我们来看看需要求什么: 1.当前熟了的食物的最小id 2.当前熟了的食物中有没有编号为id的食物 3.当前没熟的食物中有没有编号为id的食物 4.当前没 ...
- 基于matlab的傅里叶变换
原文出处https://blog.csdn.net/qq_37366291/article/details/79832886 例子1 作用:使用傅里叶变换找出隐藏在噪声中的信号的频率成分.(指定信号的 ...
- 安装LoadRunner11时,缺少vc2005_sp1_with_atl_fix_redist错误的解决方案
安装LoadRunner11时,会报缺少vc2005_sp1_with_atl_fix_redist错误,类似下图所示: 由提示信息可知,这里是由于本机缺少该组件所致,解决方案就是安装此组件,可以去网 ...
- Request.Cookies和Response.Cookies
Request.Cookies创建的Cookie只能用于后台不能用于HTML的前台Response.Cookies操作过的Cookie,所有方法获取到的都是被更新过的值,也就是说Response.Co ...
- hdu4324 dfs
scanf("%1d")这种好像很慢. #include<stdio.h> #include<string.h> #define maxn 2010 str ...
- 关于Apple Watch,听听开发了两个月Watch App的工程师怎么说
今年1月份有幸应苹果邀请,秘密参与苹果 Watch App 的真机现场调试.4月份,Apple Watch 会正式上市.在这之前,也算是亲自抢先体验了 Apple Watch,以及开发了一下 Watc ...
- UVA_494:Kindergarten Counting Game
Language: C++ 4.8.2 #include<stdio.h> #include<ctype.h> int main(void) { int ch; int wor ...