A.

/*
从大往小依次除
*/ #include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<set>
#include<map>
#define M
#define ll long long using namespace std;
int read() {
int nm = , f = ;
char c = getchar();
for(; !isdigit(c); c = getchar()) if(c == '-') f = -;
for(; isdigit(c); c = getchar()) nm = nm * + c - '';
return nm * f;
}
int main() {
int n = read(), ans = ;
ans += n / ;
n %= ;
ans += n / ;
n %= ;
ans += n / ;
n %= ;
ans += n / ;
n %= ;
ans += n;
cout << ans; return ;
}

B.

/*
发现每个路口何时进去是能算出来的 所以O1扫一遍即可 */ #include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<set>
#include<map>
#define M 100010
#define ll long long using namespace std;
int read() {
int nm = , f = ;
char c = getchar();
for(; !isdigit(c); c = getchar()) if(c == '-') f = -;
for(; isdigit(c); c = getchar()) nm = nm * + c - '';
return nm * f;
} int note[M]; int main() {
int n = read(), id, minn = 0x3e3e3e3e;
for(int i = ; i <= n; i++)
{
note[i] = read();
int op = note[i] - i + ;
int zz = (op + n - ) / n;
if(zz < minn) minn = zz, id = i;
}
cout << id;
return ;
}

C.

D.

/*
贪心的写法 每次 选择最靠左的一个不连续的 将右边的贪心移动过来 */ #include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<set>
#include<map>
#define M
#define ll long long using namespace std;
int read() {
int nm = , f = ;
char c = getchar();
for(; !isdigit(c); c = getchar()) if(c == '-') f = -;
for(; isdigit(c); c = getchar()) nm = nm * + c - '';
return nm * f;
} int main() { return ;
}

Codeforces Round #492 (Div. 2)的更多相关文章

  1. [Codeforces Round #492 (Div. 1) ][B. Suit and Tie]

    http://codeforces.com/problemset/problem/995/B 题目大意:给一个长度为2*n的序列,分别有2个1,2,3,...n,相邻的位置可以进行交换,求使所有相同的 ...

  2. 【Codeforces】Codeforces Round #492 (Div. 2) (Contest 996)

    题目 传送门:QWQ A:A - Hit the Lottery 分析: 大水题 模拟 代码: #include <bits/stdc++.h> using namespace std; ...

  3. Codeforces Round #492 (Div. 2) [Thanks, uDebug!]

    这次的题好奇怪哦... C - Tesla 思路:先把跟停车位相邻的车停进去,然后开始转圈... #include<bits/stdc++.h> #define LL long long ...

  4. Codeforces Round #366 (Div. 2) ABC

    Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...

  5. Codeforces Round #354 (Div. 2) ABCD

    Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/out ...

  6. Codeforces Round #368 (Div. 2)

    直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...

  7. cf之路,1,Codeforces Round #345 (Div. 2)

     cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....   ...

  8. Codeforces Round #279 (Div. 2) ABCDE

    Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/outpu ...

  9. Codeforces Round #262 (Div. 2) 1003

    Codeforces Round #262 (Div. 2) 1003 C. Present time limit per test 2 seconds memory limit per test 2 ...

随机推荐

  1. learnopengl“入门”的全部代码

    projection 里的角度,角度越大,物体离摄像机越远:角度越小,物体离摄像机越近,这个角度表示视野(fov),视野越大,看到的物体就越小 头文件 #ifndef SHADER_H_INCLUDE ...

  2. spring boot 整合dubbo

    dubbo与springboot的集成和使用dubbo-spring-boot-starter SpringBoot整合Dubbo2.5.10(官方的spring-boot-starter0.1.0) ...

  3. nginx配置遇到的一个大坑

    鄙人负责的项目即将上线,今天团队伙伴反应网站上的图片,有的可以显示有的不可以显示报404,找我看看问题. 我心想啊,404,应该是没有文件才出的,于是,我直接上nginx服务器上查看,检查路径下是否有 ...

  4. SDI core端口说明

    SDI core端口说明 本文基于赛灵思的官方文档以及自己的理解: 1.生成SDI core 2.得到SDI core的顶层文件,并对每个端口做出解释 smpte_sdi smpte_sdi ( .r ...

  5. excel技巧--复制带excel侧边的表格

    假设要复制出带excel侧边的表格内容,则使用以下步骤: 1.选择要复制的表格: 2.选择“页面布局”->“标题”选项的“打印”打勾: 3.选择“开始”->复制旁的三角选项:复制为图片: ...

  6. 手机开发者模型,上方显示p dx dy xv yv

    prs:当前压强 (红色的时候 表示 压强趋向稳定或达到最大压强)p:触碰点状况p:(x/y) x为当前监控的触摸点 y为当次触摸屏幕操作最大触摸点个数 你可以理解为 y是有多少根手指放过在屏幕上 x ...

  7. NutzWk 开发框架

    官网: https://wizzer.cn/ 源码下载: https://github.com/wizzercn/NutzWk/ https://gitee.com/wizzer/NutzWk Int ...

  8. mysql 事务学习

    1.事务 逻辑上的一组操作,组成这组操作的各个逻辑单元要么一起成功,要么一起失败. 2.事务特性 原子性:强调事务的不可分割.一致性:强调的是事务的执行的前后,数据的完整性要保持一致.隔离性:一个事务 ...

  9. Linux Docker安装Jenkins

    安装环境 操作系统 centos7.3 安装Docker,安装及配置见 <Docker之Docker介绍及安装配置> 安装Jenkins 下载Jenkins 命令:sudo docker ...

  10. C++进阶--构造函数和析构函数中的虚函数

    //############################################################################ /* 任何时候都不要在构造函数或析构函数中 ...