結果
| 問題 | No.123 カードシャッフル | 
| コンテスト | |
| ユーザー |  Haijinn | 
| 提出日時 | 2016-11-30 20:41:23 | 
| 言語 | C90 (gcc 12.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 11 ms / 5,000 ms | 
| コード長 | 315 bytes | 
| コンパイル時間 | 142 ms | 
| コンパイル使用メモリ | 20,864 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-27 14:01:57 | 
| 合計ジャッジ時間 | 692 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 10 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d %d",&n,&m);
      |         ^~~~~~~~~~~~~~~~~~~~
main.c:17:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |         scanf("%d",&q);
      |         ^~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
int main(void)
{
	int n,m,i,d,temp,s,q;
	int a[10000];
	scanf("%d %d",&n,&m);
	for(i=1;i<=n;i++){
		a[i]=i;
		/*for(d=0;d<a[i];d++){
	a[0]=a[i];
}*/
		
	}
	
for(d=0;d<m;d++){
	scanf("%d",&q);
	temp=a[q-1];
	for(s=q-1;s>0;s--){
	a[s]=a[s-1];
	
	}
	a[0]=temp;
}
printf("%d\n",a[0]+1);
	return 0;
}
            
            
            
        