A

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int n,num=;
string s;
cin>>n;
cin>>s;
for(int i=;i<n;i++){
if(s[i]!='') num++;
if(s[i]==''){ cout<<num;num=;}
}
cout<<num;
return ;
}

B

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<iostream>
using namespace std;
typedef long long ll;
string ss[];
int main(){
for(int i=;i<;i++){
cin>>ss[i];
}
for(int i=;i<;i++){
for(int j=;j<;j++){
int num=;
bool flag=false;
for(int k=;k<;k++){
if(ss[i][j+k]=='X') num++;
if(ss[i][j+k]=='O') flag=true;
}
if(num==&&flag==false){
cout<<"YES\n";
return ;
}
if(i<){
num=;
flag=false;
for(int k=;k<;k++){
if(ss[i+k][j+k]=='X') num++;
if(ss[i+k][j+k]=='O') flag=true;
}
if(num==&&flag==false){
cout<<"YES\n";
return ;
}
num=;
flag=false;
for(int k=;k<;k++){
if(ss[i+k][j]=='X') num++;
if(ss[i+k][j]=='O') flag=true;
}
if(num==&&flag==false){
cout<<"YES\n";
return ;
}
}
if(i>=){
num=;
flag=false;
for(int k=;k<;k++){
if(ss[i-k][j+k]=='X') num++;
if(ss[i-k][j+k]=='O') flag=true;
}
if(num==&&flag==false){
cout<<"YES\n";
return ;
}
}
}
}
for(int i=;i<;i++){
for(int j=;j<;j++){
int num=,flag=false;
for(int k=;k<;k++){
if(ss[i+k][j]=='X') num++;
if(ss[i+k][j]=='O') flag=true;
}
if(num==&&flag==false){
cout<<"YES\n";
return ;
}
}
}
cout<<"NO\n";
return ; }

C

 #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[];
int main(){
int n,k,num=,temp;
cin>>n>>k;
temp=*k;
for(int i=;i<n;i++) cin>>a[i];
sort(a,a+n);
for(int i=;i<n;i++){
if(a[i]>temp){
while(temp<a[i]){
num++;
temp*=;
}
}
temp=max(temp,*a[i]);
}
cout<<num<<endl;
}

D

 #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[],ss[];
int main(){
string s,t;
cin>>s>>t;
int k=;
for(int i=;i<s.size();i++){
if(s[i]=='?') ss[k++]=i;
else a[s[i]-'a']++;
}
for(int i=;i<k;){
for(int j=;j<t.size();j++){
if(a[t[j]-'a']>) a[t[j]-'a']--;//复杂度只有O(k+n)不是n*m
else{
s[ss[i]]=t[j];
i++;
if(i==k) break;
}
}
}
cout<<s; }

待更

codeforces educational round25的更多相关文章

  1. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://cod ...

  2. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://code ...

  3. Codeforces Educational Round 33 题解

    题目链接   Codeforces Educational Round 33 Problem A 按照题目模拟,中间发现不对就直接输出NO. #include <bits/stdc++.h> ...

  4. Codeforces Educational Round 92 赛后解题报告(A-G)

    Codeforces Educational Round 92 赛后解题报告 惨 huayucaiji 惨 A. LCM Problem 赛前:A题嘛,总归简单的咯 赛后:A题这种**题居然想了20m ...

  5. codeforces Educational Codeforces Round 5 A. Comparing Two Long Integers

    题目链接:http://codeforces.com/problemset/problem/616/A 题目意思:顾名思义,就是比较两个长度不超过 1e6 的字符串的大小 模拟即可.提供两个版本,数组 ...

  6. codeforces Educational Codeforces Round 16-E(DP)

    题目链接:http://codeforces.com/contest/710/problem/E 题意:开始文本为空,可以选择话费时间x输入或删除一个字符,也可以选择复制并粘贴一串字符(即长度变为两倍 ...

  7. Codeforces Educational Codeforces Round 15 E - Analysis of Pathes in Functional Graph

    E. Analysis of Pathes in Functional Graph time limit per test 2 seconds memory limit per test 512 me ...

  8. Codeforces Educational Codeforces Round 15 D. Road to Post Office

    D. Road to Post Office time limit per test 1 second memory limit per test 256 megabytes input standa ...

  9. Codeforces Educational Codeforces Round 15 C. Cellular Network

    C. Cellular Network time limit per test 3 seconds memory limit per test 256 megabytes input standard ...

随机推荐

  1. Java 9 逆天的十大新特性

    在介绍java9之前,我们先来看看java成立到现在的所有版本. 1990年初,最初被命名为Oak: 1995年5月23日,Java语言诞生: 1996年1月,第一个JDK-JDK1.0诞生: 199 ...

  2. scp的用法

    scp是有Security的文件copy,基于ssh登录.命令基本格式:scp [OPTIONS] file_source file_target OPTIONS:-v 和大多数 linux 命令中的 ...

  3. IE6、IE7、IE8及其他浏览器多个元素并排显示

    IE6.IE7.IE8及其他浏览器多个元素并排显示 HTML代码 <div class="line"> <h1>全部input框</h1> &l ...

  4. Codeforces 876C Classroom Watch:枚举

    题目链接:http://codeforces.com/contest/876/problem/C 题意: 定义函数:f(x) = x + 十进制下x各位上的数字之和 给你f(x)的值(f(x) < ...

  5. jquery插件之jquery.extend和jquery.fn.extend的区别

    jquery.extend jquery.extend(),是拓展jquery这个类,即可以看作是jquery这个类本身的静态方法,例如: <!DOCTYPE html> <html ...

  6. php深入浅出session

    1. session概念 0 2. http协议与状态保持 0 3. 理解cookie 0 4. php中session的生成机制 2 5. php中session的过期回收机制 3 6. php中s ...

  7. Linux课程---9、安装RPM包(RPM的全称是什么)

    Linux课程---9.安装RPM包(RPM的全称是什么) 一.总结 一句话总结: redhat package management 1.在Packages中查找和php相关的文件如何查找? ls ...

  8. 初识JQuery(1)-选择器

    初识jquery 在学习jquery之前,就有看过一些相关的视频,才知道它是可以写很少的代码就可以完成很多事的.记得第一写轮播图的时候,首先就百度了篇轮播图的实现,当时还不知道自己百度的其实不是原生的 ...

  9. 手把手编写PHP框架 深入了解MVC运行流程

    1 什么是MVC MVC模式(Model-View-Controller)是软件工程中的一种软件架构模式,把软件系统分为三个基本部分:模型(Model).视图(View)和控制器(Controller ...

  10. (转)java向MySQL插入当前时间的四种方式和java时间日期格式化的几种方法(案例说明)

    java向MySQL插入当前时间的四种方式和java时间日期格式化的几种方法(案例说明);部分资料参考网络资源 1. java向MySQL插入当前时间的四种方式 第一种:将java.util.Date ...