Codeforces Round #492 (Div. 2)
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)的更多相关文章
- [Codeforces Round #492 (Div. 1) ][B. Suit and Tie]
http://codeforces.com/problemset/problem/995/B 题目大意:给一个长度为2*n的序列,分别有2个1,2,3,...n,相邻的位置可以进行交换,求使所有相同的 ...
- 【Codeforces】Codeforces Round #492 (Div. 2) (Contest 996)
题目 传送门:QWQ A:A - Hit the Lottery 分析: 大水题 模拟 代码: #include <bits/stdc++.h> using namespace std; ...
- Codeforces Round #492 (Div. 2) [Thanks, uDebug!]
这次的题好奇怪哦... C - Tesla 思路:先把跟停车位相邻的车停进去,然后开始转圈... #include<bits/stdc++.h> #define LL long long ...
- 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 ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
- Codeforces Round #368 (Div. 2)
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...
- cf之路,1,Codeforces Round #345 (Div. 2)
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... ...
- Codeforces Round #279 (Div. 2) ABCDE
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems # Name A Team Olympiad standard input/outpu ...
- 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 ...
随机推荐
- TypeScript 之 类型推导
https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/Type%20Inference.html 类型推导:发生在初始化变 ...
- python引入自定义模块
Python的包搜索路径 Python会在以下路径中搜索它想要寻找的模块:1. 程序所在的文件夹2. 标准库的安装路径3. 操作系统环境变量PYTHONPATH所包含的路径 将自定义库的路径添加到Py ...
- 用monit监控mongodb,崩溃后自动重启mongdb
什么是monit Monit是一个跨平台的用来监控Unix/linux系统(比如Linux.BSD.OSX.Solaris)的工具.Monit特别易于安装,而且非常轻量级(只有500KB大小),并且不 ...
- 安装centos7启动项配置
安装centos7启动项配置 1.将 setparams 'Install CentOS Linux 7' linuxefi/images/pxeboot/vmlinuz inst.stage2=hd ...
- 53题看透java线程
1) 什么是线程? 线程是操作系统能够进行运算调度的最小单位,它被包含在进程之中,是进程中的实际运作单位.程序员可以通过它进行多处理器编程,你可以使用多线程对运算密集型任务提速.比如,如果一个线程完成 ...
- 黄聪:Fiddler对安卓应用手机抓包图文教程
做开发需要抓取手机app的http/https的数据包,想看APP发出的http请求和响应是什么,这就需要抓包了,这可以得到一些不为人知的api,比如还可以干些“坏事”... 需要工具: Fiddle ...
- navigator 判断移动端是Android还是iOS
let u = navigator.userAgent; let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > - ...
- BlueZone automation note1
To run the patch test cases in C:\sliData\TAF\bzw\test-packs\run_jobs via run_example_tests_smoke_te ...
- elasticsearch 口水篇(3)java客户端 - Jest
elasticsearch有丰富的客户端,java客户端有Jest.其原文介绍如下: Jest is a Java HTTP Rest client for ElasticSearch.It is a ...
- jQuery绑定和解绑点击事件及重复绑定解决办法
原文地址:http://www.111cn.net/wy/jquery/47597.htm 绑点击事件这个是jquery一个常用的功能,如click,unbind等等这些事件绑定事情,但还有很多朋友不 ...