結果
問題 |
No.339 何人が回答したのか
|
ユーザー |
![]() |
提出日時 | 2017-01-21 20:45:49 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 420 bytes |
コンパイル時間 | 507 ms |
コンパイル使用メモリ | 22,016 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-23 04:27:24 |
合計ジャッジ時間 | 2,426 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 WA * 21 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:19:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | scanf("%d",&n); | ^~~~~~~~~~~~~~ main.c:22:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | scanf("%d",&a[i]); | ^~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<string.h> int max(int a,int b){ int x=1,i; if(a>b){ int temp; temp=a; a=b; b=temp; } for(i=1;i<=a;i++) if(a%i==0 && b%i==0){ x=i; } return x; } int main(void){ int n,temp=1; scanf("%d",&n); int a[n],i; for(i=0;i<n;i++) scanf("%d",&a[i]); if(n==1){ printf("1\n"); return 0; } for(i=0;i<n-1;i++) temp=max(a[i],a[i+1]); printf("%d\n",100/temp); }