The 2018 ACM-ICPC Asia Qingdao Regional Contest
The 2018 ACM-ICPC Asia Qingdao Regional Contest
青岛总体来说只会3题
C
#include<bits/stdc++.h>
using namespace std;
#define maxn 3000005
char a[maxn],b[maxn];
int c[maxn],ll[maxn],rr[maxn];
int main(){
int t;
cin>>t;
while(t--){
int n;
scanf("%d",&n);
scanf("%s",a);
scanf("%s",b);
;j<n;j++){
if(a[j]!=b[j]){
c[j]=;
};
}
;
;
;j<strlen(a);j++){
//if(fa&&c[j]==1) continue;
&&c[j]==){
rr[i-]=j;
fa=;
}&&c[j]==){
ll[i]=j;
i++;
fa=;
}
}
]==) rr[i-]=n-;
){
printf()/);
}){
]-ll[i-]+;
)*+1LL*(n-k)*;
printf("%lld\n",ans);
}){
printf("6\n");
}else{
printf("0\n");
}
}
;
}
E
#include<bits/stdc++.h>
using namespace std;
#define maxn 200005
#define LL long long
LL a[maxn],b[maxn];
LL n,m;
bool fa(LL x){
LL ans=;
;j<n;j++){
){
b[j]=x/a[j];
}else{
b[j]=x/a[j]+;
}
}
;j<n;j++){
&&b[j]<) break;
ans++;
){
ans+=(b[j]-)*;
b[j+]-=b[j]-;
}
;
}
;
}
int main(){
int t;
cin>>t;
while(t--){
scanf("%lld%lld",&n,&m);
LL mx=;
;j<n;j++){
scanf("%lld",&a[j]);
mx=max(mx,a[j]);
}
LL l=,r=mx*m;
) cout<<"<<endl;
else{
while(l<r){
LL mid=(r+l)/;
;
else r=mid;
}
printf(,l-));
}
}
;
}
J
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
;
int Min( int a , int b ){ return a<b?a:b; }
int n,m,a[maxn];
int main()
{
int T; scanf( "%d" , &T );
; cas<=T ; cas++ )
{
,num = ;
scanf ( "%d%d" , &n , &m );
; i<=n ; i++ )
{
int x; scanf( "%d" , &x );
) cnt++;
else a[++num] = x;
}
if ( m==n ) printf( "Richman\n" );
else if ( m<cnt ) printf( "Impossible\n" );
else
{
LL ans = ; ;
; i<=num ; i++ )
{
if ( i<=m-cnt ) ans += a[i];
else tmp = Min( tmp , a[i] );
}
printf( );
}
}
;
}
M
#include<bits/stdc++.h>
using namespace std;
#define LL long long
]={,,,,,,,,,};
int main(){
int t;
cin>>t;
while(t--){
int n,z;
scanf("%d%d",&n,&z);
//cout<<"2"<<endl;
){
||n==) break;
) break;
;
int k=n;
){
LL ii=k%;
i+=fa[ii];
k/=;
}
n=i;
z--;
}
){
printf("%d\n",n);
}else{
==){
printf("%d\n",n);
}else{
printf("%d\n",fa[n]);
}
}
}
}
The 2018 ACM-ICPC Asia Qingdao Regional Contest的更多相关文章
- The 2018 ACM-ICPC Asia Qingdao Regional Contest(部分题解)
摘要: 本文是The 2018 ACM-ICPC Asia Qingdao Regional Contest(青岛现场赛)的部分解题报告,给出了出题率较高的几道题的题解,希望熟悉区域赛的题型,进而对其 ...
- ACM ICPC Central Europe Regional Contest 2013 Jagiellonian University Kraków
ACM ICPC Central Europe Regional Contest 2013 Jagiellonian University Kraków Problem A: Rubik’s Rect ...
- 2019-2020 ICPC, Asia Jakarta Regional Contest (Online Mirror, ICPC Rules, Teams Preferred)
2019-2020 ICPC, Asia Jakarta Regional Contest (Online Mirror, ICPC Rules, Teams Preferred) easy: ACE ...
- The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online J - Press the Button(思维)
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4056 题意 有一个按钮.一个灯.一个计时器和一个计数器,每按一次按钮,计时 ...
- The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online -C:Halting Problem(模拟)
C Halting Problem In computability theory, the halting problem is the problem of determining, from a ...
- The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online Solution
A Live Love 水. #include<bits/stdc++.h> using namespace std; typedef long long ll; ; const i ...
- 2018-2019, ICPC, Asia Yokohama Regional Contest 2018 K
传送门:https://codeforces.com/gym/102082/attachments 题解: 代码: /** * ┏┓ ┏┓ * ┏┛┗━━━━━━━┛┗━━━┓ * ┃ ┃ * ┃ ━ ...
- ZOJ - 4048 Red Black Tree (LCA+贪心) The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online
题意:一棵树上有m个红色结点,树的边有权值.q次查询,每次给出k个点,每次查询有且只有一次机会将n个点中任意一个点染红,令k个点中距离红色祖先距离最大的那个点的距离最小化.q次查询相互独立. 分析:数 ...
- 2018 ICPC Asia Jakarta Regional Contest
题目传送门 题号 A B C D E F G H I J K L 状态 Ο . . Ο . . Ø Ø Ø Ø . Ο Ο:当场 Ø:已补 . : 待补 A. Edit Distance Thin ...
随机推荐
- MySQL 的两个特殊属性 unsigned与 zerofill
1 unsigned unsigned 就是将数字类型无符号化, 例如 int 型的范围:-2^31 ~ 2^31 - 1,而unsigned int的范围:0 ~ 2^32.看起来unsigned ...
- [转帖]Centos7 yum安装Chrome浏览器
Centos7 yum安装Chrome浏览器 https://www.cnblogs.com/ianduin/p/8727333.html以及https://blog.csdn.net/libaine ...
- [转帖]SPU、SKU、ID,它们都是什么意思,三者又有什么区别和联系呢?
SPU.SKU.ID,它们都是什么意思,三者又有什么区别和联系呢? http://blog.sina.com.cn/s/blog_5ff11b130102wx0p.html 电商时代,数据为王. 所以 ...
- spring AOP源码分析(一)
对于springAOP的源码分析,我打算分三部分来讲解:1.配置文件的解析,解析为BeanDefination和其他信息然后注册到BeanFactory中:2.为目标对象配置增强行为以及代理对象的生成 ...
- Client将数据读写HDFS流程
HDFS介绍 HDFS(Hadoop Distributed File System )Hadoop分布式文件系统.是根据google发表的论文翻版的. 什么是分布式文件系统 分布式文件系统(Dist ...
- Hbase存储流程
- 用junit对java代码进行测试,需要注意
1.用@Test注解的方法必须没有返回值,返回值类型无:void 2.用@Test注解的方法必须没有参数.
- Python魔法方法(magic method)细解几个常用魔法方法(下)
接上文,再介绍最后几个常用的魔法方法. 关于__dict__: 先上个例子: class Test(object): fly = True def __init__(self, age): self. ...
- react 入坑笔记(二) - State
React State 一. state 大致思想:在 react 中,每个组件都是一个状态机,通过与用户的交互,实现不同状态,然后渲染 UI,让用户界面和数据保持一致.React 里,只需更新组件的 ...
- Go语言类型(布尔、整型、数组、切片、map等)
1.基本类型 布尔类型:bool 注意:布尔类型不能接受其他类型的赋值,不支持自动或强制的类型转换. 整型:int8.byte(uint8).int16.int.uint.uintptr int.ui ...