#define HAVE_STRUCT_TIMESPEC
#include<bits/stdc++.h>
using namespace std;
vector<char>ans;
char a[][];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
for(int i='';i<='';++i)
ans.emplace_back(i);
for(int i='A';i<='Z';++i)
ans.emplace_back(i);
for(int i='a';i<='z';++i)
ans.emplace_back(i);
int t;
cin>>t;
while(t--){
int r,c,k;
cin>>r>>c>>k;
int cnt=;
for(int i=;i<=r;++i)
for(int j=;j<=c;++j){
cin>>a[i][j];
if(a[i][j]=='R')
++cnt;
}
int x=cnt/k,y=cnt%k;
int pt=;
int tx=x;
if(y)
++tx,--y;
for(int i=;i<=r;++i){
if(i&){
for(int j=;j<=c;++j){
if(a[i][j]=='R')
--tx,--cnt;
a[i][j]=ans[pt];
if(!cnt)
continue;
if(!tx){
++pt;
if(y)
tx=x+,--y;
else
tx=x;
}
}
}
else{
for(int j=c;j>=;--j){
if(a[i][j]=='R')
--tx,--cnt;
a[i][j]=ans[pt];
if(!cnt)
continue;
if(!tx){
++pt;
if(y)
tx=x+,--y;
else
tx=x;
}
}
}
}
for(int i=;i<=r;++i){
for(int j=;j<=c;++j)
cout<<a[i][j];
cout<<"\n";
}
}
return ;
}

Codeforces Round #601 (Div. 2)D(蛇形模拟)的更多相关文章

  1. 【cf比赛记录】Codeforces Round #601 (Div. 2)

    Codeforces Round #601 (Div. 2) ---- 比赛传送门 周二晚因为身体不适鸽了,补题补题 A // http://codeforces.com/contest/1255/p ...

  2. Codeforces Round #301 (Div. 2)(A,【模拟】B,【贪心构造】C,【DFS】)

    A. Combination Lock time limit per test:2 seconds memory limit per test:256 megabytes input:standard ...

  3. Codeforces Round #345 (Div. 2)【A.模拟,B,暴力,C,STL,容斥原理】

    A. Joysticks time limit per test:1 second memory limit per test:256 megabytes input:standard input o ...

  4. Codeforces Round #543 (Div. 2) D 双指针 + 模拟

    https://codeforces.com/contest/1121/problem/D 题意 给你一个m(<=5e5)个数的序列,选择删除某些数,使得剩下的数按每组k个数以此分成n组(n*k ...

  5. Codeforces Round #398 (Div. 2) A. Snacktower 模拟

    A. Snacktower 题目连接: http://codeforces.com/contest/767/problem/A Description According to an old lege ...

  6. Codeforces Round #601 (Div. 2)

    传送门 A. Changing Volume 签到. Code /* * Author: heyuhhh * Created Time: 2019/11/19 22:37:33 */ #include ...

  7. Codeforces Round #237 (Div. 2) B题模拟题

    链接:http://codeforces.com/contest/404/problem/B B. Marathon time limit per test 1 second memory limit ...

  8. Codeforces Round #371 (Div. 2) C 大模拟

    http://codeforces.com/contest/714/problem/C 题目大意:有t个询问,每个询问有三种操作 ①加入一个数值为a[i]的数字 ②消除一个数值为a[i]的数字 ③给一 ...

  9. Codeforces Round #436 (Div. 2)C. Bus 模拟

    C. Bus time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input out ...

随机推荐

  1. EF CodeFirst关于Mysql如何自动生成数据库表

    相对于sqlserver数据库,mysql的配置过程相对麻烦一些,我们从0讲起. 1.新建一个控制台应用程序 右键点击引用--管理NuGet程序包,搜索Mysql.Data.Entity并安装,安装完 ...

  2. jQuery - 下拉框

    jQuery - option的值 获取值 $("#equip_show").change(function(){ //获取文本 var checkText = $("# ...

  3. 一则关于控制文件全部丢失后如何重新编目RMAN元数据的简单实验

    主题:一则简单的RMAN元数据编目实验,来自于博客园AskScuti. 场景:RMAN备份完整情况下,未使用Catalog目录库.删除了所有的控制文件,在手工重建后,导致记录在控制文件中的RMAN备份 ...

  4. python3练习100题——026

    原题链接:http://www.runoob.com/python/python-exercise-example26.html 题目:利用递归方法求5!. 是25题递归方式的简化版所以很容易. 我的 ...

  5. unity命令行参数

    Typically, Unity will be launched by double-clicking its icon from the desktop but it is also possib ...

  6. nginx.conf 配置记录

    #user nobody; #启动进程,通常设置成和cpu的数量相等 worker_processes 1; #全局错误日志及PID文件 #error_log lognginxs/error.log; ...

  7. java8快速实现分组、过滤、list转map

    public class TestEntity { private String c1; private String c2; public TestEntity(){} public TestEnt ...

  8. php 法大大对接

    通过编写扩展实现, 实现两种方式签署 1, 存证签署 存证签署流程 /** *个人 *客户在平台注册(姓名,身份证,手机号)---->三要素验证----->获取客户编号-------> ...

  9. Flink架构(一)- 系统架构

    1. 系统架构 Flink是一个分布式系统,用于有状态的并行数据流处理.也就是说,Flink会分布式地运行在多个机器上.在分布式系统中,常见的挑战有:如何对集群中的资源进行分配与管理.协调进程.数据存 ...

  10. 寒假安卓app开发学习记录(6)

    今天把之前学过的内容复习了一遍,然后用了大概一个小时的时间看了看教学视频. 学到的主要内容是如何调试Android程序,以及Android的应用以及打包过程.   调试: 依次点击Run“-”Atta ...