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. mysql之 重建GTID下主从关系

    主库:mysqldump -uroot -pmysql -S /tmp/mysql.sock1 --single-transaction --add-drop-database --master-da ...

  2. docker 学习资料

    docker 学习资料 学习资料 网址 Docker 教程(菜鸟教程) http://www.runoob.com/docker/docker-tutorial.html

  3. taro 微信小程序原生作用域获取

    在 Taro 的页面和组件类中,this 指向的是 Taro页面或组件实例. 但是一般我们需要获取 Taro的页面和组件 所对应的 小程序原生页面和组件实例,这个时候我们可以通过 this.$scop ...

  4. reduceByKey和groupByKey区别与用法

    在spark中,我们知道一切的操作都是基于RDD的.在使用中,RDD有一种非常特殊也是非常实用的format——pair RDD,即RDD的每一行是(key, value)的格式.这种格式很像Pyth ...

  5. JS IE 打开本地exe程序

    例: try{ //新建一个ActiveXObject对象 var exe = new ActiveXObject("wscript.shell"); var exePath = ...

  6. Spring Schedule实现定时任务

    applicationContext.xml 1. 增加配置 <!-- 开启定时任务 --> <task:annotation-driven /> <!-- 开启注解 - ...

  7. Oracle存储过程和自定义函数笔记

    学习地址:https://www.imooc.com/learn/370 存储过程和存储函数定义:指存储在数据库中供所有用户程序调用的子程序叫做存储过程 .存储函数. 相同点:完成特定功能的程序.区别 ...

  8. 排序算法<No.4>【基数排序】

    由于春节,以及项目要上线的原因,导致这期的算法博文跟进的有点慢,内疚! 今天要介绍的是排序算法中的基数排序(Radix Sort),这类排序也是一个分而治之的排序,是对桶排序的一个升级和改造,也是稳定 ...

  9. 把指定的字符串翻译成 pig latin。

    freecodecamp上的算法题: 把指定的字符串翻译成 pig latin. Pig Latin 把一个英文单词的第一个辅音或辅音丛(consonant cluster)移到词尾,然后加上后缀 & ...

  10. xe5 android 调用照相机获取拍的照片[转]

    本篇文章我们来看一下delphi xe5 在android程序里怎样启动照相机并获取所拍的照片,本代码取自xe自带打sample,路径为: C:\Users\Public\Documents\RAD ...