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. Eclipse各个版本及其对应代号、下载地址列表

    版本号 代码 日期 下载地址 Eclipse 3.1 IO[木卫一,伊奥] 2005 http://archive.eclipse.org/eclipse/downloads/drops/R-3.1- ...

  2. 【python】多线程详解

    一.进程与线程关系 一个进程至少包含一个线程. 二.线程基础 1.线程的状态 线程有5种状态,状态转换的过程如下图所示: 2.线程同步(锁) 多线程的优势在于可以同时运行多个任务(至少感觉起来是这样) ...

  3. Delphi XE5的Android开发平台搭建[转]

    Delphi XE5支持Android ARM的开发,可以在Android虚拟机里运行,因此建议将XE5安装在64bit的Windows,内存可以大于3GB Delphi XE5安装光盘中包含了最基本 ...

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

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

  5. ThinkPHP 介绍及安装 -1

    一.ThinkPHP的介绍 MVC M - Model 模型                工作:负责数据的操作 V - View  视图(模板)        工作:负责前台页面显示 C - Con ...

  6. gcc同时使用动态和静态链接

    场景是这样的.我在写一个Nginx模块,该模块使用了MySQL的C客户端接口库libmysqlclient,当然mysqlclient还引用了其他的库,比如libm, libz, libcrypto等 ...

  7. 前端入门应该掌握的html+css知识点

    * 文档流 元素从上自下从左到右排列,即文档流 (所以一个普通的元素前面有一个向右浮动的元素,这个元素不会和这个浮动元素发生重叠,但是如果这个普通元素前面是一个向左浮动的元素,可以看到 元素会和浮动元 ...

  8. dfs常见的配置文件中的value与description(重要)

    不多说,直接上干货! name value description dfs.namenode.logging.level info The logging level for dfs namenode ...

  9. 利用itext导出PDF的小例子

    我这边使用的jar包: itext-2.1.7.jar itextasian-1.5.2.jar 代码,简单的小例子,导出pdf: PdfService.java: package com.cy.se ...

  10. react中的数据请求

    在react中,没有提供专门的请求数据的模块,所以我们可以采用第三方请求数据的模块进行数据请求,常见的有axios和fetch-jsonp,下面来总结这两种方式的用法. axios 查看文档 http ...