Codeforces - 1117E - Crisp String - 进制 - 交互
2024-08-23 10:42:05
https://codeforces.com/problemset/problem/1117/E
就用abc表示数字来给每个数编码,编完直接问出移动的结果,反构造就行了,比C和D还简单。
#include<bits/stdc++.h>
using namespace std;
#define ll long long int n;
string s1,s2,s3; string t;
string q1,q2,q3; int pos[];
char s[]; void construct(){
for(int i=;i<n;i++){
s1+=(char)('a'+i%);
} int i=;
for(int p=;p<n;){
for(int j=;j<&&p<n;j++,p++){
s2+=(char)('a'+i%);
}
i++;
} i=;
for(int p=;p<n;){
for(int j=;j<*&&p<n;j++,p++){
s3+=(char)('a'+i%);
}
i++;
} //cout<<s1<<endl<<s2<<endl<<s3<<endl;
} void solve(){
for(int i=;i<n;i++){
int pp=;
pp+=(q3[i]-'a');
pp*=;
pp+=(q2[i]-'a');
pp*=;
pp+=(q1[i]-'a');
pos[i]=pp;
} /*for(int i=0;i<n;i++){
cout<<pos[i]<<" ";
}
cout<<endl;*/ for(int i=;i<n;i++){
s[pos[i]]=t[i];
} s[n]='\0';
cout<<"! "<<s<<endl;
fflush(stdout); } int main(){
cin>>t;
n=t.length();
construct(); cout<<"? "<<s1<<"\n";
fflush(stdout);
cin>>q1; cout<<"? "<<s2<<"\n";
fflush(stdout);
cin>>q2; cout<<"? "<<s3<<"\n";
fflush(stdout);
cin>>q3; solve();
}
最新文章
- C#--图片上传(PC端和APP)保存及 跨域上传说明
- iOS - XIB之AutoLayout添加约束
- Linux(CentOS)系统下设置nginx开机自启动
- thinkphp 代码执行
- MS14-025引起的问题 - 2
- easyui源码翻译1.32--ValidateBox(验证框)
- JAVA反射系列之Field,java.lang.reflect.Field使用获取方法
- 【Python爬虫实战--2】时间戳转换为指定格式日期
- 使用redis所维护的代理池抓取微信文章
- Java之List排序
- iOS 动态 Framework 对App启动时间影响实测
- 加壳工具-Virbox Protector Standalone
- python2.7安装beautifulsoup包
- Openvpn配置文件详解
- linux 挂载磁盘
- Spring Boot 静态资源映射与上传文件路由配置
- Android高级_第三方下载工具Volley
- Ubuntu x86-64汇编(4) 数值操作指令
- Android测试跑单个包脚本文件
- VSCode集成TypeScript编译
热门文章
- [转]c中按位分配int的方法
- git log 查看版本演变历史
- [Testing] Static Analysis Testing JavaScript Applications
- SolidEdge如何自动标注尺寸
- Effective C++ 条款九、十 绝不在构造和析构过程中调用virtual函数|令operator=返回一个reference to *this
- BAT&;注册表重定向劫持
- BEGINNING SHAREPOINT&;#174; 2013 DEVELOPMENT 第8章节--配送SP2013Apps 应用程序生命周期
- 把node加入master节点时,日志内容分析
- JSON与localStorage的爱恨情仇
- 蓝牙BlueTooth技术学习理解