当前位置:网站首页>2019 Hangzhou Electric Multi School Game 9 6684 Rikka with game [game question]
2019 Hangzhou Electric Multi School Game 9 6684 Rikka with game [game question]
2022-07-24 19:34:00 【Cold instant noodles】
2019 Hangzhou Electric Power Co., Ltd Scene nine 6684-Rikka with Game【 Game problem 】
General meaning :
Give a string ,R First of all ,R I want to change the dictionary order of strings to smaller ,Y I want to change the dictionary order of strings , Everyone takes turns to revise , Every time everyone has two choices , One is to change the letter of a certain digit back to a digit , such as a->b, d->e, The second is to end the game . Ask what the modified string looks like .
Ideas :
A game problem .
If the first is a~x The letter of , If you modify it first , Then the backhand ends the game directly . If you don't modify it first , Then the backhand goes directly to add the first , Then, no matter who changes it first , The backhand will end the game directly in the next round .
If the first is y, If you modify it first, it will become z , Then the backhand will end the game directly . If you don't modify it first , If later revised , That first hand will continue to be revised into a, Then it will be modified to b, At this point, the first hand will choose to end the game . So no matter who will not modify y Of .
If the first is z , First hand will definitely be modified to a, Later modified as b, Then finish the game first .
So the conclusion is , Find the first string that is not y The characters of , If it is z It is modified to b And end the game , Otherwise, end the game directly .
Code :
#include<cstdio>
#include<iostream>
#include<string.h>
using namespace std;
int main() {
int t;
char ss[1000];
scanf("%d",&t);
while(t--) {
scanf("%s",ss);
int lenss = strlen(ss);
for(int i = 0; i < lenss; i++) {
if(ss[i] != 'y') {
if(ss[i] == 'z') {
ss[i] = 'b';
break;
}
else
break;
}
}
puts(ss);
}
return 0;
}
边栏推荐
- Solutions to oom caused by pictures in res directory
- Get module handle / base address
- day 3
- [resolved] CVC datatype valid. 1.2.1: '' is not a valid value for 'ncname'.
- C language implementation of raii
- Ebpf verifier
- 拦截器和过滤器
- Machine learning_ Data processing and model evaluation
- Unity框架之ConfigManager【Json配置文件读写】
- Software core data protection solution
猜你喜欢

Biopharmaceutical safety, power supply and production guarantee
![[JVM learning 03] class loading and bytecode Technology](/img/b4/9482b02b58580171235fd4c36129e9.png)
[JVM learning 03] class loading and bytecode Technology

Summary of articles in 2020

day 2

Create a life cycle aware MVP architecture

Clion configuring WSL tool chain

Look at the interface control devaxpress WinForms - how to customize auxiliary function properties (Part 2)

asp. Net coree file upload and download example

How to encrypt your own program with dongle

Timed task framework
随机推荐
[Huawei lyevk-3861a intelligent IOT development board evaluation] unpacking experience and Hisilicon hi3861v100 chip learning experience
【校招面经】8道指针面试真题,快来检测自己掌握了几道。
asp. Net core, C # summary about path
Colon sorting code implementation
Data transmission of different fragments in the same activity
Leetcode402 remove K digits
Decorator of function
[in depth study of 4g/5g/6g topic -39]: urllc-10 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -3- how to distinguish urllc services? Detailed expl
Feature extraction tool transformer Bert
Modelarts, Pangu big model, ModelBox... Detailed explanation of Huawei cloud AI development production line
Convolutional Neural Networks in TensorFlow quizs on Coursera
C # shelling tool for code encryption protection
Leetcode652 finding duplicate subtrees
6.0 holes stepped by fragment request permission in the system
思源笔记 v2.1.2 同步问题
How to select the shelling tool?
Rotation matrix derivation process
Unity code imports packages through package manager
Wireshark simple filter rule
Ebpf verifier