Submission #73303391
Source Code Expand
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int n= sc.nextInt();
String[] a= new String[n];
int max=0;
for (int i=0;i<n;i++){
a[i]=sc.next();
max= (max>a[i].length())?max:a[i].length();
}
for (int k=0;k<n;k++){
int x= (max-a[k].length())/2;
for (int j=0;j<x;j++) System.out.print(".");
System.out.print(a[k]);
for (int j=0;j<x;j++) System.out.print(".");
System.out.println("");
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Center Alignment |
| User | Krr1ssh_ |
| Language | Java24 (OpenJDK 24.0.2) |
| Score | 200 |
| Code Size | 627 Byte |
| Status | AC |
| Exec Time | 98 ms |
| Memory | 41704 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| 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 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 72 ms | 40904 KiB |
| 00_sample_02.txt | AC | 72 ms | 40848 KiB |
| 01_random_01.txt | AC | 98 ms | 41184 KiB |
| 01_random_02.txt | AC | 94 ms | 41704 KiB |
| 01_random_03.txt | AC | 88 ms | 41168 KiB |
| 01_random_04.txt | AC | 91 ms | 41036 KiB |
| 01_random_05.txt | AC | 93 ms | 40908 KiB |
| 01_random_06.txt | AC | 84 ms | 40580 KiB |
| 02_min_01.txt | AC | 70 ms | 40852 KiB |
| 03_max_01.txt | AC | 97 ms | 41304 KiB |