結果
問題 |
No.135 とりあえず1次元の問題
|
ユーザー |
👑 ![]() |
提出日時 | 2015-08-06 01:25:03 |
言語 | C90 (gcc 12.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 245 bytes |
コンパイル時間 | 2,462 ms |
コンパイル使用メモリ | 37,504 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-03 06:12:18 |
合計ジャッジ時間 | 3,133 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 RE * 4 |
ソースコード
#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; }