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. 3个问题:MySQL 中 character set 与 collation 的理解;utf8_general_ci 与 utf8_unicode_ci 区别;uft8mb4 默认collation:utf8mb4_0900_ai_ci 的含义

    MySQL 中 character set 与 collation 的理解 出处:https://www.cnblogs.com/EasonJim/p/8128196.html 推荐: 编码使用 uf ...

  2. 阿里云 qW3xT.4 挖矿病毒问题

    查了一下.是个挖矿病毒,cpu 占用巨高 .杀了又有守护进程启动.网上有些杀死这个病毒的办法,大家可以试试.但是不确定能杀死. 建议直接重装系统. 然后,说说这货怎么传播的. 他通过redis .目前 ...

  3. MySQL通过Navicat实现远程连接

    直接使用Navicat通过IP连接会报各种错误,例如:Error 1130: Host '192.168.1.80' is not allowed to connect to this MySQL s ...

  4. 运行成功的Demo(Python+Appium)

    原文摘自:廖丹  http://www.cnblogs.com/android-it/p/8805659.html 1.打开Appium运行 2.在Pycharm输入代码如下所示: from appi ...

  5. linux od命令详解

    Linux od命令 Linux od命令用于输出文件内容.od指令会读取所给予的文件的内容,并将其内容以八进制字码呈现出来 将指定文件以八进制形式(默认)转储到标准输出.如果指定了多于一个的文件参数 ...

  6. mysql 删除数据库中所有的表中的数据,只删database下面所有的表。

    select concat('drop table ',table_name,';') from TABLES where table_schema='数据库名称'; select concat('t ...

  7. Ubuntu16.04系统重装***

    首先准备一个Live CD,就是Ubuntu的安装盘. 备份原理就是将系统文件压缩打包.由于Linux系统所有都是文件,故,只需要将系统打包即可.当然,必须除了当前系统运行中的文件以及临时文件. 打包 ...

  8. php大量数据 10M数据从查询到下载 【内存溢出,查询过慢】解决方案

    功能描述:做数据导出 功能分析:1.采用csv的格式,因为csv的格式比excel小 2. 3W条数据,100个字段需要全部导出 开始 直接查询 //此处使用的laravel框架,具体含义一看就懂 t ...

  9. 数据仓库专题20-案例篇:电商领域数据主题域模型设计v0.2(改进意见征集中)

    一.电商分类(平台+自营+复合) (1)平台型电商:淘宝+天猫+百度Mall等: (2)自营型电商: 2.1 综合型:京东(早期)+当当(早期): 2.2 垂直型:好像这种类型越来越少了: (3)复合 ...

  10. 当弹出的div失去焦点的时候自动隐藏

    jquery: $("#button").click(function(event){ $("#box").show(); event.stopPropagat ...