結果

問題 No.135 とりあえず1次元の問題
コンテスト
ユーザー testestest
提出日時 2015-08-06 01:44:09
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 3,720 ms / 5,000 ms
+ 605µs
コード長 204 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 78 ms
コンパイル使用メモリ 30,336 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-24 00:40:10
合計ジャッジ時間 18,140 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);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[100000],s,t=-1;
scanf("%d",&n);s=n;
while(s)scanf("%d",a+n-s--);
while(n--,m=n)while(m--)if(s=a[n]-a[m],s=s<0?-s:s)t=!~t||s<t?s:t;
printf("%d",~t?t:0);
return 0;
}
0