結果
問題 | No.256 桁の数字を入れ替え (2) |
ユーザー | kenji_shioya |
提出日時 | 2016-06-05 16:45:56 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 1,161 ms / 2,000 ms |
コード長 | 513 bytes |
コンパイル時間 | 3,385 ms |
コンパイル使用メモリ | 78,016 KB |
実行使用メモリ | 55,364 KB |
最終ジャッジ日時 | 2024-04-17 04:58:04 |
合計ジャッジ時間 | 6,449 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 118 ms
41,240 KB |
testcase_01 | AC | 119 ms
41,100 KB |
testcase_02 | AC | 1,147 ms
55,268 KB |
testcase_03 | AC | 1,161 ms
55,364 KB |
ソースコード
import java.util.*; public class Exercise62{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); String str = sc.next(); String[] array = str.split(""); Integer[] nums = new Integer[array.length]; for (int i = 0; i < array.length; i++){ nums[i] = Integer.valueOf(array[i]); } Arrays.sort(nums, Comparator.reverseOrder()); str = ""; for (int i = 0; i < nums.length; i++){ str += nums[i]; } System.out.println(str); } }