Submission #3258843
Source Code Expand
import java.lang.*;
import java.io.*;
import java.util.*;
class Main{
public static void main(String args[]) throws Exception{
FScanner sc=new FScanner();
//Scanner sc=new Scanner(System.in);
String[] s=sc.readStringL("");
String[] t=sc.readStringL("");
int[] cs=new int[123];
int[] ct=new int[123];
for(String c: s){
cs[c.getBytes("US-ASCII")[0]]+=1;
}
for(String c: t){
ct[c.getBytes("US-ASCII")[0]]+=1;
}
Arrays.sort(cs);
Arrays.sort(ct);
boolean slv=true;
for(int i=0; i<cs.length; i++){
if(cs[i]!=ct[i]){
slv=false;
}
}
System.out.println((slv==true)? "Yes": "No");
}
static void solve(int cur, int nx, int en, int hld){}
static void disp(int[] data){
for(int i=0; i<data.length; i++){
System.out.printf("%d ",data[i]);
}
System.out.println();
}
static void disp(String[] data){
for(int i=0; i<data.length; i++){
System.out.printf("%s ",data[i]);
}
System.out.println();
}
static void disp(long[] data){
for(int i=0; i<data.length; i++){
System.out.printf("%d ",data[i]);
}
System.out.println();
}
static class FScanner{
BufferedReader read=null;
StringTokenizer tok=null;
Scanner sc;
FScanner() throws FileNotFoundException{
sc=new Scanner(System.in);
}
boolean hasNextLine(){
boolean has=true;
if(!sc.hasNextLine()){
has=false;
}
return has;
}
int readInt(){
String buf=sc.nextLine();
return Integer.parseInt(buf);
}
long readLong(){
long i=Long.parseLong(sc.nextLine());
return i;
}
int[] readIntL(){
String[] buf=sc.nextLine().split(" ");
int[] num=new int[buf.length];
for(int i=0; i<buf.length; i++){
num[i]=Integer.parseInt(buf[i]);
}
return num;
}
String readString(){
return sc.nextLine();
}
String[] readStringL(String dlm){
String[] s=sc.nextLine().split(dlm);
return s;
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - String Transformation |
| User | tokumei_jp |
| Language | Java8 (OpenJDK 1.8.0) |
| Score | 300 |
| Code Size | 1999 Byte |
| Status | AC |
| Exec Time | 460 ms |
| Memory | 66548 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01, sample_02, sample_03 |
| All | 0_min0, 0_min1, 1_small0, 1_small1, 1_small2, 2_medium0, 2_medium1, 2_medium2, 2_medium3, 2_medium4, 3_max0, 3_max1, 3_max2, 3_max3, 3_max4, 3_max5, 3_max6, 3_max7, 3_max8, 3_max9, 5_hand0, sample_01, sample_02, sample_03 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 0_min0 | AC | 102 ms | 19284 KiB |
| 0_min1 | AC | 97 ms | 19540 KiB |
| 1_small0 | AC | 96 ms | 20692 KiB |
| 1_small1 | AC | 96 ms | 21844 KiB |
| 1_small2 | AC | 97 ms | 21332 KiB |
| 2_medium0 | AC | 400 ms | 59568 KiB |
| 2_medium1 | AC | 375 ms | 48460 KiB |
| 2_medium2 | AC | 213 ms | 30092 KiB |
| 2_medium3 | AC | 398 ms | 64512 KiB |
| 2_medium4 | AC | 366 ms | 49040 KiB |
| 3_max0 | AC | 439 ms | 65784 KiB |
| 3_max1 | AC | 419 ms | 63212 KiB |
| 3_max2 | AC | 433 ms | 64128 KiB |
| 3_max3 | AC | 414 ms | 65312 KiB |
| 3_max4 | AC | 401 ms | 65356 KiB |
| 3_max5 | AC | 408 ms | 64576 KiB |
| 3_max6 | AC | 430 ms | 66548 KiB |
| 3_max7 | AC | 460 ms | 63244 KiB |
| 3_max8 | AC | 458 ms | 64188 KiB |
| 3_max9 | AC | 457 ms | 62124 KiB |
| 5_hand0 | AC | 97 ms | 19412 KiB |
| sample_01 | AC | 97 ms | 19796 KiB |
| sample_02 | AC | 98 ms | 22740 KiB |
| sample_03 | AC | 96 ms | 21844 KiB |