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 ...
随机推荐
- nexus 私有 maven 仓库的搭建
下载地址 页面 : https://help.sonatype.com/repomanager3/download 首先需要安装jdk .安装棒法我 前面的文章有写.https://www.cnblo ...
- bzoj 2739 最远点——分治处理决策单调性
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2739 分治处理决策单调性的思想就是先找到一个询问,枚举所有可能的转移找到它的决策点,那么这个 ...
- java byte数组与String的相互转换
String -> byte数组 String str = "abc天"; byte[] btr = str.getBytes(); System.out.printl ...
- phpmailer SMTP connect() failed的解决方法
使用PHPMailer发邮件的时候,经常出现本地可以发送,上传到服务器就发送失败了.老是提示SMTP connect() failed 今天我也遇到了这样的问题,用的是QQ的邮箱服务器,查了下资料,很 ...
- [转CSDN多篇文章]WEB 3D SVG CAD 矢量 几种实现方案
WEB 3D SVG CAD 矢量 几种实现方案 原创 2014年10月24日 08:34:11 标签: WEB3D / CADSVG / 矢量 2665 一.全部自己开发,从底层开始 VML+SVG ...
- django 数据模型中 null=True 和 blank=True 有什么区别
null: If True, Django will store empty values as NULL in the database. Default is False. 如果为True,空值将 ...
- Java Base64编码
使用commons-codec, 下载地址 http://commons.apache.org/proper/commons-codec/ 下载commons-codec-1.12-bin.zip,解 ...
- java锁在等待唤醒机制中作用
等待的线程放在线程池wait().notify().notifyall()都使用在同步中,因为要对持有监视器(锁)的线程操作.所以要使用在同步中,因为只有同步才具有锁. 为什么这些操作的线程的方法要定 ...
- Java第03次实验提纲(面向对象1-基本概念)
0. 将码云的项目clone到本机 请参考使用Eclipse Egit与码云管理你的代码中的3 从码云将项目clone到你的电脑 之后就可以在Eclipse中提交本地项目新增或修改的文件.如果在Ecl ...
- lucene 4.0 - Facet demo
package com.fox.facet; import java.io.File; import java.io.IOException; import java.util.ArrayList; ...