結果

問題 No.123 カードシャッフル
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-13 18:48:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 524 ms / 5,000 ms
コード長 545 bytes
コンパイル時間 2,283 ms
コンパイル使用メモリ 72,060 KB
実行使用メモリ 60,636 KB
最終ジャッジ日時 2023-08-20 04:32:58
合計ジャッジ時間 6,735 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,700 KB
testcase_01 AC 126 ms
55,520 KB
testcase_02 AC 127 ms
56,088 KB
testcase_03 AC 128 ms
55,740 KB
testcase_04 AC 132 ms
55,520 KB
testcase_05 AC 128 ms
55,760 KB
testcase_06 AC 129 ms
55,940 KB
testcase_07 AC 129 ms
55,988 KB
testcase_08 AC 126 ms
56,140 KB
testcase_09 AC 126 ms
55,728 KB
testcase_10 AC 493 ms
60,420 KB
testcase_11 AC 518 ms
60,352 KB
testcase_12 AC 518 ms
60,408 KB
testcase_13 AC 524 ms
60,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		StringBuilder sb = new StringBuilder();
		for (int i=1; i<=n; i++) {
			if (i < 10) {sb.append("0");}
			sb.append(i);
		}
		
		int m = sc.nextInt();
		for (int i=0; i<m; i++) {
			int end = sc.nextInt()*2;
			int start = end - 2;
			sb.insert(0,sb.substring(start,end));
			sb.delete(start+2,end+2);
		}
		
		int ans = Integer.parseInt(sb.substring(0,2));
		
		System.out.println(ans);
	}
}
0