結果

問題 No.2827 Enter User Name to Play
ユーザー vjudge1
提出日時 2025-04-17 18:10:36
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 640 bytes
コンパイル時間 4,062 ms
コンパイル使用メモリ 80,756 KB
実行使用メモリ 56,396 KB
最終ジャッジ日時 2025-04-17 18:10:46
合計ジャッジ時間 8,253 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

// 24K-3032
import java.util.Scanner;
public class MainQ1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("Enter the string");
        String s = scan.next();
        int n=s.length();
        int[] arr = new int[n];
        for(int i=0; i<n; i++){
            System.out.println("Enter pemutation "+(i+1));
            arr[i] = scan.nextInt();
        }

        char c;
        char[] formatted = new char[n];
        for(int i=0; i<n; i++){
            c = s.charAt(arr[i]-1);
            formatted[i] = c;
        }
        System.out.println(formatted);
    }
}
0