結果
| 問題 | No.390 最長の数列 |
| コンテスト | |
| ユーザー |
Hissha_
|
| 提出日時 | 2018-04-03 14:46:10 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 466 bytes |
| 記録 | |
| コンパイル時間 | 181 ms |
| コンパイル使用メモリ | 40,384 KB |
| 最終ジャッジ日時 | 2026-02-22 00:57:08 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 4 WA * 1 RE * 10 |
コンパイルメッセージ
main.c: In function 'main':
main.c:5:20: warning: result of '10^5' is 15; did you mean '1e5'? [-Wxor-used-as-pow]
5 | int n, x[10^5], y[10^5], i, j, k=0, count=0, max=0;
| ^
| ---
| 1e
main.c:5:18: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
5 | int n, x[10^5], y[10^5], i, j, k=0, count=0, max=0;
| ^~
| 0xa
main.c:5:29: warning: result of '10^5' is 15; did you mean '1e5'? [-Wxor-used-as-pow]
5 | int n, x[10^5], y[10^5], i, j, k=0, count=0, max=0;
| ^
| ---
| 1e
main.c:5:27: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
5 | int n, x[10^5], y[10^5], i, j, k=0, count=0, max=0;
| ^~
| 0xa
ソースコード
#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;
}
Hissha_