关闭

【模拟】Codeforces 711A Bus to Udayland

标签: 题解Codeforces模拟
160人阅读 评论(0) 收藏 举报
分类:

题目链接:

  http://codeforces.com/problemset/problem/711/A

题目大意:

  N个字符串,每个字符串5位,找到第一个出现两个OO的并改成++输出YES和改后字符串,没有输出NO.

题目思路:

  【模拟】

  签到题。看阅读理解能力和手速。




//
//by coolxxx
//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<memory.h>
#include<time.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//#include<stdbool.h>
#include<math.h>
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(a) ((a)>0?(a):(-(a)))
#define lowbit(a) (a&(-a))
#define sqr(a) ((a)*(a))
#define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))
#define mem(a,b) memset(a,b,sizeof(a))
#define eps (1e-8)
#define J 10
#define mod 1000000007
#define MAX 0x7f7f7f7f
#define PI 3.14159265358979323
#define N 1004
using namespace std;
typedef long long LL;
int cas,cass;
int n,m,lll,ans;
char s[N][10];
int main()
{
	#ifndef ONLINE_JUDGE
//	freopen("1.txt","r",stdin);
//	freopen("2.txt","w",stdout);
	#endif
	int i,j,k;
	
//	for(scanf("%d",&cass);cass;cass--)
//	for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
//	while(~scanf("%s",s+1))
	while(~scanf("%d",&n))
	{
		for(i=1;i<=n;i++)
			scanf("%s",s[i]);
		for(i=1;i<=n;i++)
		{
			if(s[i][0]==s[i][1] && s[i][0]=='O')
			{
				s[i][0]=s[i][1]='+';
				break;
			}
			else if(s[i][3]==s[i][4] && s[i][3]=='O')
			{
				s[i][3]=s[i][4]='+';
				break;
			}
		}
		if(i<=n)
		{
			puts("YES");
			for(i=1;i<=n;i++)
				puts(s[i]);
		}
		else puts("NO");
	}
	return 0;
}
/*
//

//
*/


0
0
查看评论

Codeforces 711A Bus to Udayland

A. Bus to Udayland time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outp...
  • llwwlql
  • llwwlql
  • 2016-08-30 10:12
  • 323

codeforces——711A—— Bus to Udayland

A. Bus to Udayland time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ...
  • lose__way
  • lose__way
  • 2017-06-14 15:32
  • 165

CodeForces 711A Bus to Udayland

A. Bus to Udayland time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outp...
  • yao1373446012
  • yao1373446012
  • 2016-09-07 16:39
  • 138

CodeForces 711A A. Bus to Udayland

A. Bus to Udayland time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outp...
  • qq_37943488
  • qq_37943488
  • 2017-09-05 15:01
  • 98

CodeForces 711A Bus to Udayland(水题)

A. Bus to Udayland time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outp...
  • hhu1506010220
  • hhu1506010220
  • 2016-08-30 00:05
  • 238

Codeforces Problem 711A Bus to Udayland(brute force+implementation)

Codeforces Problem 711A Bus to Udayland(brute force+implementation)
  • queuelovestack
  • queuelovestack
  • 2016-08-30 09:08
  • 905

Codeforces刷题之路——711A Bus to Udayland

A. Bus to Udayland time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outp...
  • CodingXiaoGuo
  • CodingXiaoGuo
  • 2016-08-30 10:51
  • 429

【Codeforces Round #369 (Div. 2)】Codeforces 711A Bus to Udayland

模拟
  • sdfzyhx
  • sdfzyhx
  • 2016-08-30 13:53
  • 162

Codeforces 864C Bus(模拟水题)

车子来回跑,中间可以加油,判断最少要加几次油 每次都先跑到加油站,判断从加油站走到终点(回来的时候则走到起点再走到加油站)再走到加油站油还够不够 不够就加,如果是最后一次journey(这个特判一下就好)就不加那么多,判断走完全程最后油量是否一直满足大于等于0 注意不能一开始就把不能走来回的数...
  • T__TSZ
  • T__TSZ
  • 2017-09-25 21:06
  • 301

Codeforces Bus to Udayland

import java.util.Scanner; public class BusToUdayland { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n...
  • Lutte_
  • Lutte_
  • 2017-06-26 09:32
  • 93
    个人资料
    • 访问:79905次
    • 积分:2539
    • 等级:
    • 排名:第17065名
    • 原创:243篇
    • 转载:2篇
    • 译文:0篇
    • 评论:17条
    文章分类
    最新评论