結果
| 問題 | No.365 ジェンガソート | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-12-01 19:09:30 | 
| 言語 | C90 (gcc 12.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 12 ms / 2,000 ms | 
| コード長 | 205 bytes | 
| コンパイル時間 | 510 ms | 
| コンパイル使用メモリ | 20,608 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-27 16:01:33 | 
| 合計ジャッジ時間 | 1,892 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 41 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d",&n);
      |         ^~~~~~~~~~~~~~
main.c:6:31: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         for(i = 1;i <= n;i++){scanf("%d",&a[i]);}
      |                               ^~~~~~~~~~~~~~~~~
            
            ソースコード
#include<stdio.h>
int main(void){
	int n,a[131072],i,p;
	scanf("%d",&n);
	for(i = 1;i <= n;i++){scanf("%d",&a[i]);}
	p = n;
	for(i = n;i >= 1;i--){
		if(p == a[i]){p--;}
	}
	printf("%d\n",p);
	return 0;
}
            
            
            
        