結果
問題 | No.123 カードシャッフル |
ユーザー |
![]() |
提出日時 | 2016-05-22 15:33:50 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 533 ms / 5,000 ms |
コード長 | 419 bytes |
コンパイル時間 | 1,886 ms |
コンパイル使用メモリ | 74,712 KB |
実行使用メモリ | 48,004 KB |
最終ジャッジ日時 | 2024-10-06 20:31:47 |
合計ジャッジ時間 | 5,642 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 10 |
ソースコード
import java.util.*;class No0123{public static void main(String[] args){Scanner sc = new Scanner(System.in);int n = sc.nextInt();int m = sc.nextInt();int a = 0;ArrayList<Integer> ar = new ArrayList<Integer>();for(int i = 0; i < n; i++){ar.add(i + 1);}for(int i = 0; i < m; i++){a = sc.nextInt();ar.add(0, ar.get(a - 1));ar.remove(a);}System.out.println(ar.get(0));}}