結果
問題 |
No.123 カードシャッフル
|
ユーザー |
|
提出日時 | 2016-03-11 20:08:48 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 602 bytes |
コンパイル時間 | 3,686 ms |
コンパイル使用メモリ | 76,484 KB |
実行使用メモリ | 56,324 KB |
最終ジャッジ日時 | 2024-09-25 00:53:31 |
合計ジャッジ時間 | 6,810 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 6 RE * 4 |
ソースコード
package 練習; import java.util.Date; import java.util.Scanner; public class main{ public static void main(String[] args){ long exec_time=new Date().getTime(); Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int m=sc.nextInt(); int[] a=new int[n]; for(int i=0;i<m;i++){ a[i]=sc.nextInt()-1; } int[] now=new int[n]; for(int i=0;i<n;i++){ now[i]=i+1; } for(int i=0;i<m;i++){ int tmp=now[a[i]]; for(int j=a[i];j>=1;j--){ now[j]=now[j-1]; } now[0]=tmp; } System.out.println(now[0]); System.err.println(new Date().getTime()-exec_time+"ms"); } }