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. 【linux配置】VMware安装Redhat6.5

    VMware安装Redhat6.5 VMware安装Redhat6.5安装之前需要一些准备工作,首先,电脑上需要安装VMware(这个是废话),其次就是需要Redhat6.5的镜像文件(现在貌似都出R ...

  2. 用gradle4.4转化spring,发现依赖包integration-0.9.15.jar已经不在

    用gradle4.4转化spring,发现依赖包integration-0.9.15.jar已经不在仓库了,应该怎么解决? 解决办法如下: 1  修改build.gradle文件,将id " ...

  3. JavaScript字符串、数组、对象方法总结

    字符串方法 示例字符串: const str = "hello,kitty,hello,vue "; 一.基本方法 charAt(n) 返回指定索引的字符 charCodeAt(n ...

  4. ORACLE 最后表数据更新的时间

    SELECT SCN_TO_TIMESTAMP(MAX(ora_rowscn)) from myTable;

  5. EMAS,一部淘宝十年移动互联网技术的演进史

    导读 本文根据2018云栖大会深圳峰会·EMAS专场—移动互联的进化论,阿里巴巴高级技术专家泠茗< EMAS全景介绍>的演讲整理而成,文中就EMAS的起源史及EMAS的五大移动研发场景解决 ...

  6. Javascript一些要点记录

    1. == 比较,它会自动转换数据类型再比较 === 比较,它不会自动转换数据类型,如果数据类型不一致,返回false 大部分时候应该使用===来比较2. 使用'use strict'来强制通过var ...

  7. JavaScript-- 函数既是函数又是对象

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. 【Leetcode 滑动窗口】顺次数(1291)

    题目 我们定义「顺次数」为:每一位上的数字都比前一位上的数字大 1 的整数. 请你返回由 [low, high] 范围内所有顺次数组成的 有序 列表(从小到大排序).   示例 1: 输出:low = ...

  9. pycharm 2017 序列号失效问题解决(2016-2017版本都有效)

    pycharm 序列号失效问题解决   this license BIG3CLIK6F has been cancelled  具体如下: 对,没错,这个激活码本来可以使用到2018年的,但是,忽然间 ...

  10. 【风马一族_php】NO3_php基础知识

    原文来自:http://www.cnblogs.com/sows/p/6001079.html(博客园的)风马一族 侵犯版本,后果自负 回顾 PHP基础语法 1.标签:<?php //PHP 代 ...