【模拟】Codeforces 711A Bus to Udayland
题目链接:
http://codeforces.com/problemset/problem/711/A
题目大意:
N个字符串,每个字符串5位,找到第一个出现两个OO的并改成++输出YES和改后字符串,没有输出NO.
题目思路:
【模拟】
签到题。看阅读理解能力和手速。
1 // 2 //by coolxxx 3 //#include<bits/stdc++.h> 4 #include<iostream> 5 #include<algorithm> 6 #include<string> 7 #include<iomanip> 8 #include<map> 9 #include<stack> 10 #include<queue> 11 #include<set> 12 #include<bitset> 13 #include<memory.h> 14 #include<time.h> 15 #include<stdio.h> 16 #include<stdlib.h> 17 #include<string.h> 18 //#include<stdbool.h> 19 #include<math.h> 20 #define min(a,b) ((a)<(b)?(a):(b)) 21 #define max(a,b) ((a)>(b)?(a):(b)) 22 #define abs(a) ((a)>0?(a):(-(a))) 23 #define lowbit(a) (a&(-a)) 24 #define sqr(a) ((a)*(a)) 25 #define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b)) 26 #define mem(a,b) memset(a,b,sizeof(a)) 27 #define eps (1e-8) 28 #define J 10 29 #define mod 1000000007 30 #define MAX 0x7f7f7f7f 31 #define PI 3.14159265358979323 32 #define N 1004 33 using namespace std; 34 typedef long long LL; 35 int cas,cass; 36 int n,m,lll,ans; 37 char s[N][10]; 38 int main() 39 { 40 #ifndef ONLINE_JUDGE 41 // freopen("1.txt","r",stdin); 42 // freopen("2.txt","w",stdout); 43 #endif 44 int i,j,k; 45 46 // for(scanf("%d",&cass);cass;cass--) 47 // for(scanf("%d",&cas),cass=1;cass<=cas;cass++) 48 // while(~scanf("%s",s+1)) 49 while(~scanf("%d",&n)) 50 { 51 for(i=1;i<=n;i++) 52 scanf("%s",s[i]); 53 for(i=1;i<=n;i++) 54 { 55 if(s[i][0]==s[i][1] && s[i][0]=='O') 56 { 57 s[i][0]=s[i][1]='+'; 58 break; 59 } 60 else if(s[i][3]==s[i][4] && s[i][3]=='O') 61 { 62 s[i][3]=s[i][4]='+'; 63 break; 64 } 65 } 66 if(i<=n) 67 { 68 puts("YES"); 69 for(i=1;i<=n;i++) 70 puts(s[i]); 71 } 72 else puts("NO"); 73 } 74 return 0; 75 } 76 /* 77 // 78 79 // 80 */
View Code
转载于:https://www.cnblogs.com/Coolxxx/p/5821994.html
【模拟】Codeforces 711A Bus to Udayland相关推荐
- CodeForces 991E Bus Number DFS+ 组合数
CodeForces 991E Bus Number DFS+ 组合数 题目大意:给定一个数字,数字里出现的每一个数,都至少要用一个,问能组成多少个新数,不加前导零. input: 2028 outp ...
- 模拟 Codeforces Round #249 (Div. 2) C. Cardiogram
题目地址:http://codeforces.com/contest/435/problem/C 1 /* 2 题意:给一组公式,一组数据,计算得到一系列的坐标点,画出折线图:) 3 模拟题:蛮恶心的 ...
- 模拟 Codeforces Round #297 (Div. 2) A. Vitaliy and Pie
题目传送门 1 /* 2 模拟:这就是一道模拟水题,看到标签是贪心,还以为错了呢 3 题目倒是很长:) 4 */ 5 #include <cstdio> 6 #include <al ...
- 模拟 Codeforces Round #288 (Div. 2) A. Pasha and Pixels
题目传送门 1 /* 2 模拟水题:给定n*m的空白方格,k次涂色,将(x,y)处的涂成黑色,判断第几次能形成2*2的黑色方格,若不能,输出0 3 很挫的判断四个方向是否OK 4 */ 5 #incl ...
- Codeforces 991E. Bus Number (DFS+排列组合)
解题思路 将每个数字出现的次数存在一个数组num[]中(与顺序无关). 将出现过的数字i从1到num[i]遍历.(i from 0 to 9) 得到要使用的数字次数数组a[]. 对于每一种a使用排列组 ...
- CodeForces - 711A 找座位 难度:C++入门 复杂度:简单 翻译难度:难
from Pisces's Trial双鱼座 输入第一个整数表多少行座位,之后输入座位的占用情况:输出是否能找到给两人一起坐并且在同侧的座位(输出YES或NO),并把找到的座位替换为"++& ...
- 【Codeforces】A2组刷题记录(50 / 50)完结
目录 A1. Counterexample A2. Good Number A3. Dice Tower ★A4. Alyona and Numbers A5. Mountain Scenery rz ...
- 2016区域赛前冲刺训练
UPD 2016.10.23 shift-and (2题) Codeforces 训练 现在已经完成了: 191 [Codeforces Round #377] (6/6) Div 2 A Buy a ...
- linux下搭建vsftp锁定根目录,Linux下创建ftp用户并锁定根目录
[root@d vsftpd]# vi /etc/vsftpd/chroot_list 加入要锁定根目录的ftp用户名(一行只能一个用户) [root@ vsftpd]# vi /etc/vsftpd ...
最新文章
- 史上最权威宏基因组软件评估—人工重组宏基因组基准数据集
- PAT甲级1106 Lowest Price in Supply Chain:[C++题解]树、结点到根结点的距离、树形dp、记忆化搜索
- python 删除n天前文件_Linux 按时间批量删除文件命令(删除N天前文件)
- 【poj3709】 K-Anonymous Sequence
- [转]IIS 允许/禁止 目录浏览
- 深入浅出 Javascript API(二)--地图显示与基本操作 转
- 四张图,读懂 BIO、NIO、AIO、多路复用 IO 的区别
- python元编程 实际应用_Python元编程
- System Verilog线程——fork join的理解使用
- [转载] python异常和错误有什么区别_python的错误和异常
- 布同:后台开发入职四年的经历和体会
- c 调用openoffice word转pdf_Word 批量转 PDF
- Java连接数据库(二):数据库连接池(druid)
- 调用平安银行接口返回GBK乱码问题
- (原创)安卓抓包方案分享
- 数据采集(三):用XPath爬取腾讯新闻
- Python开发-Django表单
- C语言 十进制转换为二进制
- (纪录片)鸟瞰中国 China from Above
- nginx配置tcp转发
热门文章
- 一次项目测评反思:数据准备、测评要求和各种问题记录
- leetcode —— 11. 盛最多水的容器
- 【完整版-斯坦福-密码学】全13讲(绪论)【笔记】
- matlab小波分析常用函数
- Multi-thread--C++11中std::mutex的使用
- 根据两点之间的连线,计算连线到各坐标轴之间的夹角(角度,弧度)
- SSH框架整合——基于注解
- linux 卸载 patch,Oracle RAC 平台下 Patch 安装与卸载 步骤 收藏
- nacos enablediscoveryclient_Spring Cloud(五):注册中心nacos篇
- 两个mapreduce 做topn_hadoop分布式计算MapReduce详细总结