Submission #75705629
Source Code Expand
#include<bits/stdc++.h>
#define ll long long
#define rep(i,l,r) for(int i=(l);i<=(r);i++)
#define per(i,r,l) for(int i=(r);i>=(l);i--)
using namespace std;
const int N=4e6+10;
int T,h,w,n,m,tot,hf,tar,cur,st,px[N],py[N],o[N];
void solve(){
cin>>h>>w;n=2*h;m=2*w;
vector<string> g(n),ans(n,string(m,'B'));
rep(i,0,n-1)cin>>g[i];int id=0;
rep(j,0,m-1)px[id]=0,py[id]=j,id++;
rep(i,1,n-1){
if(i%2)per(j,m-1,1)px[id]=i,py[id]=j,id++;
else rep(j,1,m-1)px[id]=i,py[id]=j,id++;
}
per(i,n-1,1)px[id]=i,py[id]=0,id++;
tot=4*h*w;hf=2*h*w;tar=h*w;
rep(i,0,tot-1)o[i]=(g[px[i]][py[i]]=='o');
cur=0;st=-1;rep(i,0,hf-1)cur+=o[i];
if(cur==tar)st=0;
else rep(i,1,tot-1){
cur-=o[i-1];
cur+=o[(i+hf-1)%tot];
if(cur==tar){st=i;break;}
}
rep(i,0,hf-1)ans[px[(st+i)%tot]][py[(st+i)%tot]]='A';
rep(i,0,n-1)cout<<ans[i]<<"\n";
return;
}
signed main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>T;while(T--)solve();
return 0;
}
Submission Info
Submission Time
2026-05-10 22:28:32+0900
Task
E - Equal Distribution
User
Fourier_WJY
Language
C++23 (GCC 15.2.0)
Score
600
Code Size
1068 Byte
Status
AC
Exec Time
36 ms
Memory
62984 KiB
Compile Error
./Main.cpp: In function 'void solve()':
./Main.cpp:3:20: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
3 | #define rep(i,l,r) for(int i=(l);i<=(r);i++)
| ^~~
./Main.cpp:13:5: note: in expansion of macro 'rep'
13 | rep(i,0,n-1)cin>>g[i];int id=0;
| ^~~
./Main.cpp:13:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
13 | rep(i,0,n-1)cin>>g[i];int id=0;
| ^~~
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
600 / 600
Status
Set Name
Test Cases
Sample
00_sample_00.txt
All
00_sample_00.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 02_random_17.txt, 02_random_18.txt, 02_random_19.txt, 02_random_20.txt, 02_random_21.txt, 02_random_22.txt
Case Name
Status
Exec Time
Memory
00_sample_00.txt
AC
1 ms
3644 KiB
01_handmade_00.txt
AC
6 ms
3688 KiB
01_handmade_01.txt
AC
35 ms
59836 KiB
01_handmade_02.txt
AC
33 ms
59776 KiB
01_handmade_03.txt
AC
32 ms
59644 KiB
01_handmade_04.txt
AC
22 ms
4668 KiB
01_handmade_05.txt
AC
24 ms
4772 KiB
01_handmade_06.txt
AC
23 ms
4524 KiB
01_handmade_07.txt
AC
23 ms
4772 KiB
02_random_00.txt
AC
18 ms
4684 KiB
02_random_01.txt
AC
13 ms
4488 KiB
02_random_02.txt
AC
13 ms
4784 KiB
02_random_03.txt
AC
16 ms
7476 KiB
02_random_04.txt
AC
18 ms
4768 KiB
02_random_05.txt
AC
36 ms
62984 KiB
02_random_06.txt
AC
32 ms
59880 KiB
02_random_07.txt
AC
32 ms
59820 KiB
02_random_08.txt
AC
33 ms
59860 KiB
02_random_09.txt
AC
34 ms
59852 KiB
02_random_10.txt
AC
34 ms
59868 KiB
02_random_11.txt
AC
33 ms
59816 KiB
02_random_12.txt
AC
35 ms
59824 KiB
02_random_13.txt
AC
32 ms
59672 KiB
02_random_14.txt
AC
32 ms
59696 KiB
02_random_15.txt
AC
14 ms
4524 KiB
02_random_16.txt
AC
14 ms
4812 KiB
02_random_17.txt
AC
17 ms
7592 KiB
02_random_18.txt
AC
27 ms
33888 KiB
02_random_19.txt
AC
35 ms
62980 KiB
02_random_20.txt
AC
17 ms
7372 KiB
02_random_21.txt
AC
27 ms
33880 KiB
02_random_22.txt
AC
36 ms
62980 KiB