#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. pycharm项目移植过程中遇到的问题

     调试中遇到三个问题: 问题1:Error running 'run_all_test': Cannot run program "C:\Users\Administrator\.virtu ...

  2. 剑指offer 面试题. 滑动窗口的最大值

    题目描述 给定一个数组和滑动窗口的大小,找出所有滑动窗口里数值的最大值.例如,如果输入数组{2,3,4,2,6,2,5,1}及滑动窗口的大小3,那么一共存在6个滑动窗口,他们的最大值分别为{4,4,6 ...

  3. Java连载77-Integer常用方法、Integer、int、String三者相互转化、自动装箱、自动拆箱

    一.关于Integer中常用的方法 package com.bjpowernode.java_learning; ​ public class D77_1_ { public static void ...

  4. iframe宽高自适应

    iframe子页面结尾添加本script iframe子页面结尾添加本script <script type="text/javascript">         fu ...

  5. EF简单增删改查

    第一步:创建上下文对象 using(var db = new Entities()) { //数据操作 } 新增 UserInfo user = new UserInfo() { UserName = ...

  6. Linux - Shell - find - 进阶: 时间与大小

    概述 继续 find 这次的内容, 参数稍微要 复杂那么一丢丢 背景 刚学会了 基础 的参数 现在来了解一些 时间 和 空间 的参数 一说到操控时间空间, 感觉立马起来了... 准备 OS cento ...

  7. awk从放弃到入门(3):awk变量

    一.变量概述 对于awk来说"变量"又分为"内置变量" 和 "自定义变量" , "输入分隔符FS"和"输出分隔 ...

  8. 转载:声音分贝的概念,dBSPL.dBFS

    转自:https://www.cnblogs.com/wangguchangqing/p/5947659.html 分贝 Decibel 分贝(dB)是一个对数单位(logarithmic unit) ...

  9. Oracle 11G在用EXP 导入、导出时,若有空表对导入导出中遇到的问题的解决

    11G中有个新特性,当表无数据时,不分配segment,以节省空间 解决方法: 1.insert一行,再rollback就产生segment了. 该方法是在在空表中插入数据,再删除,则产生segmen ...

  10. 使用spring中遇到"java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor"问题

    项目中缺少aopalliance的jar包,下载一个相应的jar加入项目中就可以解决问题. 下载链接:http://www.java2s.com/Code/Jar/a/Downloadaopallia ...