結果

問題 No.390 最長の数列
ユーザー Hissha_Hissha_
提出日時 2018-04-03 14:46:10
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 466 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 28,968 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 15:27:14
合計ジャッジ時間 3,381 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 0 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 0 ms
4,380 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 1 ms
4,376 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(void) {
	// your code goes here
	int n, x[10^5], y[10^5], i, j, k=0, count=0, max=0;
	
	scanf("%d", &n);
	
	for(i=0;i<n;i++){
		scanf("%d", &x[i]);
	}
	
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(x[j]<x[i]) count++;
		}
		y[count]=x[i];
		count=0;
	}
	
	count=0;

	for(i=0;i<n;i++){
		for(j=i;j<n;j++){
			if(y[j]%y[k]==0){
				count++;
				k=j;
			}
		}
		if(max<count) max=count;
		count=0;
	}
	
	printf("%d\n", max);
	
	return 0;
}
0