結果

問題 No.135 とりあえず1次元の問題
コンテスト
ユーザー testestest
提出日時 2015-08-06 01:25:03
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
RE  
実行時間 -
コード長 245 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 128 ms
コンパイル使用メモリ 30,404 KB
最終ジャッジ日時 2026-02-23 18:57:58
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18 RE * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 | scanf("%d",&n);m=s=n;
      | ^~~~~~~~~~~~~~
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 | while(s)scanf("%d",a+n-s--);
      |         ^~~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>
int main(){
int n,m,a[10000],s;
scanf("%d",&n);m=s=n;
while(s)scanf("%d",a+n-s--);
while(n--)for(s=0;s++-n;)a[s-1]>a[s]&&(a[s-1]^=a[s]^=a[s-1]^=a[s]);
while(--m)if(s=a[m]-a[m-1])n=!~n||s<n?s:n;
printf("%d",~n?n:0);
return 0;
}
0