提出 #73292099


ソースコード 拡げる

#include <bits/stdc++.h>
#define code using 
#define by namespace
#define stoneshadow std
code by stoneshadow;
typedef long long ll; 
#define caseT ll t;cin>>t;while(t--)
#define rd(x) scanf("%lld", &(x))
#define all(v) (v).begin(), (v).end()
const ll MOD=1e9+7;
const ll mxn=114514;
const ll mnn=114;

void yes(){
	cout<<"Yes"<<endl;
}
void no(){
	cout<<"No"<<endl;
}
inline ll read(){
    ll x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
ll gcd(ll a,ll b){
	if(min(a,b)==0)return max(a,b);
	if(a>b){
		a%=b;
		return gcd(a,b);
	}
	else{
		b%=a;
		return gcd(b,a);
	}
} 
void solve(){
}
long long qpow(ll base,ll p,ll K){//K=mod p=指数 base =底数 
	long long ans=1,tmp=base;
	while(p!=0){
		if(p&1){
			ans=(ans%K*tmp%K)%K;
		} 
		tmp=(tmp%K*tmp%K)%K;
		p=p>>1;
	} 
	ans=ans%K;
	return ans;
} 
int main(){
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //caseT solve();
    ll n;cin>>n;
    ll cnt=-1;
    string s[114];
    for(int i=0;i<n;i++){
    	cin>>s[i];
    	cnt=max(cnt,(ll)s[i].size());
	}
    for(int i=0;i<n;i++){
    	ll f=cnt-s[i].size();
    	f/=2;
    	while(f--){
    		s[i]='.'+s[i]+'.';
		}
	}
	for(int i=0;i<n;i++)cout<<s[i]<<endl;
    return 0;
}

提出情報

提出日時
問題 B - Center Alignment
ユーザ stone_shadow
言語 C++23 (GCC 15.2.0)
得点 200
コード長 1363 Byte
結果 AC
実行時間 1 ms
メモリ 3712 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 10
セット名 テストケース
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 02_min_01.txt, 03_max_01.txt
ケース名 結果 実行時間 メモリ
00_sample_01.txt AC 1 ms 3620 KiB
00_sample_02.txt AC 1 ms 3608 KiB
01_random_01.txt AC 1 ms 3712 KiB
01_random_02.txt AC 1 ms 3532 KiB
01_random_03.txt AC 1 ms 3552 KiB
01_random_04.txt AC 1 ms 3684 KiB
01_random_05.txt AC 1 ms 3688 KiB
01_random_06.txt AC 1 ms 3468 KiB
02_min_01.txt AC 1 ms 3592 KiB
03_max_01.txt AC 1 ms 3700 KiB