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 ...
随机推荐
- Prime Permutation
Prime Permutation 原题地址: http://codeforces.com/problemset/problem/123/A 题目大意: 给你一个字符串(只包含小写字母),从1开始存放 ...
- java随笔5 完整路径的应用
不仅类,函数,甚至参数都可以获取完整路径
- MyBatis映射文件6
之前说了由Employee找Department,这一节讲一讲由Department找Employee,显然前者是多对一的关系,而后者是一对多的关系. Department的JavaBean: pri ...
- MyBatis全局配置文件的各项标签3
mapper 将sql映射注册到全局配置中,这个我们在上一章已经使用过了, resource 这个属性是用来引用类路径下的sql映射文件 url 这个属性是用来引用网络路径或磁盘路径下的sql映射文件 ...
- Codeforces 1154G Minimum Possible LCM
题目链接:http://codeforces.com/problemset/problem/1154/G 题目大意: 给定n个数,在这些数中选2个数,使这两个数的最小公倍数最小,输出这两个数的下标(如 ...
- Golang的时间生成,格式化,以及获取函数执行时间的方法
最近都在通过完成一些列功能强化自己对常用api的熟悉. 然而关于时间的api几乎是最常用的api类型,所以总结一些常用的. 以YY-mm-dd HH:MM:SS.9位 输出当前时间: func mai ...
- 去掉dede织梦position当前位置最后一个箭头的方法
理论是,dede的当前位置标签{dedefield name='position'}结构是 首页 > 主栏目 > 子栏目 > ,这就说明,而箭头符号字段数据都是在后台设置后存储在数据 ...
- codeforces263B
Squares CodeForces - 263B Vasya has found a piece of paper with a coordinate system written on it. T ...
- hdu-3068(最长回文子串-manacher)
题意:求一个字符串#include<iostream>#include<algorithm>#include<cstring>using namespace std ...
- 【NLP】自然语言处理:词向量和语言模型
声明: 这是转载自LICSTAR博士的牛文,原文载于此:http://licstar.net/archives/328 这篇博客是我看了半年的论文后,自己对 Deep Learning 在 NLP 领 ...